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 exit in more than two and a half years.
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. "
Querrey will play either 14th-seeded Milos Raonic of Thornhill, Ont., or Frenchman 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 of Switzerland in the third round.
Eighth-seeded Janko Tipsarevic of Serbia also advanced to the third round, 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.
Gasquet hit a forehand winner to break Anderson in the ninth game of the second set for a 5-4 lead and held to level the match.
But the Frenchman fell apart in the decider, losing his serve twice and failing to pressure Anderson, who won 92 per cent of the points on his first serve. Anderson plays No. 5 Tomas Berdych of the Czech Republic, the 2005 champion, in the third round.
There were also wins for 11th-seeded Nicolas Almagro of Spain, and French players Michael Llodra and Gilles Simon.
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, a late replacement for Federer.
Later, No. 3 Andy Murray was up against Frenchman Paul-Henri Mathieu.
Rafael Nadal, who is working his way back from a knee injury, also skipped the tournament.