Novak Djokovic strode purposefully onto the court wearing a Darth Vader mask on Halloween, and went on to dominate Sam Querrey in the first set.

This time, though, it was Querrey who struck back.

The American recovered to beat the heavily favoured Djokovic 0-6, 7-6 (5), 6-4 in the second round of the Paris Masters on Wednesday — handing the Serb his earliest tournament ext in more than two and a half years.

Querrey next faces No. 14 Milos Raonic of Thornhill, Ont., who rallied from a set down and won the last three games of the match to outlast Frenchman Jeremy Chardy 6-7 (4), 7-6 (4), 6-3 on Wendesday evening.

Canadian Milos Raonic reached the third round of the Paris Masters with a 6-7(4), 7-6(4), 6-3 victory over Jeremy Chardy of France on Wednesday.

Raonic, seeded 14th thanks to his career-high ranking, kept his slim hopes alive for a late spot in the eight-man field at the World Tour Finals in London which starts Monday.

The 21-year-old from Thornhill, Ont., must reach the Sunday final in Paris and then hope for the right combination of results from other contenders for the last two spots in the event.

He has never been past the quarter-finals of an ATP Masters 1000 event.

Raonic took the first step at the final regular-season event, defeating Chardy in just over two hours with 26 aces and notching 57 winners in the first meeting between the two players.

Despite 28 unforced errors, Raonic broke Chardy for a 5-3 lead in the final set and then served out the victory on a first match point.

Third-seeded Andy Murray easily advanced, beating Paul-Henri Mathieu of France 7-5, 6-3.

The last time Djokovic lost in the second round was at the Miami Masters in March, 2010, and he said after that match that wasn't feeling in top form after a long season.

"I knew that the main problem today [would] be the continuity of my energy," Djokovic said. "The players have played so many matches and obviously struggling to be fresh, but you're trying to find that last drop of strength, mental and physical."

The Serb, known as a crowd-pleaser and a showman, did not disappoint the fans on Halloween, making a theatrical entrance and then putting on a show by winning the first set in just 21 minutes.

"It was a little embarrassing," Querrey said. "But then I got rolling and got more confidence and started serving better and being a little more aggressive."

Djokovic then started to waver under the relentless accuracy of Querrey's serve, and made too many unforced errors the rest of the way.

Querrey hit 18 aces and converted his second match point when Djokovic's return sailed long.

Djokovic had already secured the year-end No. 1 ranking after defending champion Roger Federer pulled out.

After sealing the first set with some extravagant shot-making, everything had pointed to a comfortable win for Djokovic after he broke for a 2-0 lead in the second set. But Querrey found his range, hitting 10 aces during the set. Djokovic played too many loose shots in the tiebreak and Querrey levelled the match on his first set-point when Djokovic's forehand clipped the net and bounced wide.

"I was concerned about how long I can keep that level, since physically I'm not feeling very good in last couple of days," Djokovic said. "When you're playing somebody that hits, that serves that well in the corners, there is nothing you can do."

The match turned in Querrey's favour in the fifth game of the deciding set, when he broke for a 3-2 lead with a stinging forehand winner, and held for 4-2 after another sloppy forehand from Djokovic landed in the net.

Djokovic battled back and had a great chance to level at 4-4, but Querrey saved five break points in the eighth game, three of them aces.

"I thought I served amazing, especially the big points. I felt like I made a first serve there every time," Querrey said. "I could see he was struggling a little bit, missing some shots he probably wouldn't normally miss. "

Tipsarevic keeps WTA Final hopes alive

Murray, fourth-seeded David Ferrer of Spain and No. 7 Jean Martin del Potro of Argentina won their matches comfortably.

Murray saved two break points before clinching the first set when Mathieu returned his looping second serve into the net. The Briton sealed the win on a double-fault from Mathieu. He next plays Jerzy Janowicz of Poland.

Del Potro served six aces and broke Falla three times in each set to win 6-2, 6-2. He next faces Michael Llodra of France.

Ferrer beat Marcel Granollers 6-1, 6-3 in an all-Spanish match. Ferrer, who is tied with Roger Federer for the most tour titles this year with six tournament wins, faces 16th-seeded Stanislas Wawrinka of Switzerland in the third round.

In other second-round play, eighth-seeded Janko Tipsarevic of Serbia also advanced, beating Dutchman Igor Sijsling 6-4, 7-6 (0), and keeping alive his slim chances of qualifying for the season-ending ATP World Tour Finals in London.

Ninth-seeded Juan Monaco of Argentina beat Bulgarian Grigor Dimitrov 7-6 (4), 6-2 and still has an outside chance of reaching London. Tipsarevic and Monaco play each other next, but No. 12 Richard Gasquet's chances of reaching London have gone after a 7-6 (5), 4-6, 6-1 loss to South African Kevin Anderson.

There were also wins for 11th-seeded Nicolas Almagro of Spain, Llodra and Gilles Simon of France.

Almagro beat countryman Albert Ramos 7-6 (1), 6-7 (4), 6-3; Llodra downed No. 10 John Isner of the United States 6-4, 7-6 (5), and Simon won 7-5, 6-3 against Victor Hanescu of Romania.

Rafael Nadal, who is working his way back from a knee injury, also skipped the tournament.

With files from The Canadian Press