At 1-1, 30-40 and a second breakpoint opportunity on Querrey's serve, the world No. 1 twisted his right ankle off a forehand and fell to the ground.
Wincing in pain, Djokovic had to be helped courtside. But after having the ankle taped and taking anti-inflammatories, he continued to play. He broke serve on his third breakpoint in that third game.
"I sincerely hope that I didn't make it worse and I'm going to have a few days off," Djokovic told the crowd after the match. "I was able to play some good shots at the right time.
"If I wasn't playing for Serbia, if I didn't have my teammates' support, I don't know if I would've played. The first half hour it was very painful."
Serbia advanced to a semifinal in September against Canada, which took a 3-1 lead Italy against Italy when Milos Raonic defeated Andreas Seppi 6-4, 6-4, 3-6, 7-5 in their quarterfinal tie in Vancouver, British Columbia, on Sunday.
"I am very emotional about the win today," Djokovic said. "It meant a lot to me personally. It meant a lot to the whole team.
"It meant a lot to the nation. We're very happy to be in the semifinal again."
Both teams agreed to abandon playing the fifth match of the weekend.
The other semifinal will pit defending champion Czech Republic against Argentina in the Czech Republic.
U.S. Davis Cup captain Jim Courier was not surprised that Djokovic persevered through the match.
"Novak is such a complete tennis player," Courier said. "We've seen him grow over the years not only game-wise but mentally.
"Today was an example of him drawing on that experience and energy when he had the ankle issue."
Querrey recouped the service break when Djokovic double-faulted at ad-out in the sixth game. It was the only one of seven breakpoint opportunities that Querrey was able to take advantage of in the 2-hour, 35-minute match.
Querrey was not in peak condition either. A sore pectoral muscle took away his biggest strength: serving big.
"It was more of a pec issue," Querrey said. "It hurt on my serve. I wasn't able to get my usual pop, and that's tough when you're playing against the best returner in the world."
When Djokovic broke serve for the final time in the 11th game of the first set he pounded his chest with his fist as he went courtside for the changeover.
Djokovic saved two set points against his serve in the 12th game in the second set. But at 5-4 for Querrey in the second set tiebreaker the Serb lost both his service points to lose the set.
Djokovic dominated the final two sets, never giving the top-ranked American any opening to challenge him in the latter stages. Except for Querrey holding serve in the fourth game of the third set, Djokovic won 11 of the final 12 games.
"He was just kind of feeding off his momentum and his lead," Querrey said. "When you start building a lead like that and start winning, things start to feel better.
"I think that's what happened."
More Sports Headlines
Snohomish mixed martial artist returns to her first love Mariners beat Twins 4-3 in 11 innings Charles scores 29 points, Liberty beat Storm 78-62 Park wins Women's British Open, captures 4th different major Perry wins 2nd straight Champions Tour's 3M Championship Merritt shoots 67 to win Quicken Loans National by 3 shots Triple Crown winner American Pharoah wins $1.75 million Haskell Invitational Bills' Ryan names Incognito starting left guard
Our new comment system is not supported in IE 7. Please upgrade your browser here.