Updated

American Sam Querrey used 18 aces to upset top-ranked Novak Djokovic 0-6, 7-6 (5), 6-4 Wednesday in the second round of the Paris Masters.

It marked the first time since the Miami Masters in March 2010 that Djokovi's been eliminated so early in a tournament.

Djokovic entered the court wearing a Darth Vader mask on Halloween and put on a show by winning the first set in just 21 minutes. But Djokovic started to waver under the relentless accuracy of Querrey's serve and made too many unforced errors the rest of the way.

Querrey converted his second match point when Djokovic's return sailed long.

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

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

Querrey will play either 14th-seeded Milos Raonic or Jeremy Chardy in the third round.

Earlier, fourth-seeded David 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, converted five of his six break points while dropping his serve only once.

He faces 16th-seeded Stanislas Wawrinka in the third round.

Eighth-seeded Janko Tipsarevic defeated Igor Sijsling 6-4, 7-6 (0) to maintain his slim chance of qualifying for the season-ending ATP World Tour Finals in London.

Ninth-seeded Juan Monaco beat Grigor Dimitrov 7-6 (4), 6-2. Tipsarevic and Monaco play each other next.

Richard Gasquet lost 7-6 (5), 4-6, 6-1 to South African Kevin Anderson.

Later, No. 3 Andy Murray will play Paul-Henri Mathieu.