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 against Italy when Milos Raonic defeated Andreas Seppi 6-4, 6-4, 3-6, 7-5 in their quarterfinal 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."