Spain's own Juan Martín del Potro came painfully close to dethroning one of tennis' reigning champions.
But just when it looked as if he was headed for his offseason vacation, Novak Djokovic started playing his best tennis.
The top-ranked Serb was broken late in the first set and again early in the second, but he then found his stroke and quickly rebounded to beat Del Potro 4-6, 6-3, 6-2 Sunday and reach the championship match at the season-ending ATP finals.
"Well, I had a little, let's say, crisis in today's match from 4-all, first set to 2-all in the second, where I didn't feel so good on the court, struggling to find my momentum and my rhythm," Djokovic said. "So you try to be positive and push myself to fight for every point and believe I can come back. That was the case."
Djokovic will face six-time champion Roger Federer or Andy Murray in Monday's final. Federer and Murray play in Sunday's other semifinal.
"Whoever I play against tomorrow, it's going to be very open," said Djokovic, who beat Murray in the group stage. "I think there is not really any predictions about who's going to win."
Federer and Murray are playing each other in London for the third time this year. The Swiss star beat Murray in the Wimbledon final for his seventh title at the All England Club, but Murray bounced back to defeat Federer in the Olympic final on the same Centre Court grass.
Del Potro took the lead late in the first set, breaking Djokovic for a 5-4 lead before serving out the set at love.
The tall Argentine, who defeated Djokovic to win the Olympic bronze medal at Wimbledon this year, then went up a break early in the second set. But Djokovic broke right back to 2-2 and then took Del Potro's serve again to take a 5-3 lead.
"He's so good," Del Potro said. "Of course, he's the No. 1. In these kinds of matches, they make the difference between them and the rest of the players."
In the third, Djokovic decided things by winning 12 of 13 points in a three-game stretch to take a 3-1 lead. He broke again three games later and held at love to advance.
"I believed that I could come back," said Djokovic, who treated the media to chocolates during his post-match news conference to thank them for work throughout the year. "I believed that I could turn this match around in my favor, and I've done so."
The victory was Djokovic's 74th of the season, tying him with David Ferrer for the most this year. It was also his seventh win in nine matches against Del Potro.
Djokovic won the ATP finals in 2008, and reached the semifinals in 2009 — the first year the tournament was played at the O2 Arena in London.
Based on reporting by the Associated Press.