|ATP World Tour Finals, O2 Arena London|
|Coverage: Final on BBC Two (18:00-19:00 GMT) and BBC Three (19:00 GMT) & BBC website; live commentary on 5 live sports extra, live text commentary on BBC website|
Roger Federer saved four match points before winning a thrilling all-Swiss semi-final against Stan Wawrinka at the ATP World Tour Finals.
The six-time champion wrestled control from his compatriot and came through 4-6 7-5 7-6 (8-6) in London.
Second seed Federer will take on world number one Novak Djokovic in Sunday's final - live on BBC Two at 18:00 GMT.
Wawrinka and Federer will team up next week as Switzerland try to win the Davis Cup in France.
It looked as though the 17-time Grand Slam champion would be heading to Lille first when his friend and team-mate moved within one point of victory four times.
Wawrinka, 29, served for victory at 5-4 in the decider but might regret choosing to serve-volley on three match points, missing a makeable backhand volley on the second.
|2003||Beat Andre Agassi||6-3 6-0 6-4|
|2004||Beat Lleyton Hewitt||6-3 6-2|
|2005||Lost to David Nalbandian||6-7 (4-7) 6-7 (11-13) 6-2 6-1 7-6 (7-3)|
|2006||Beat James Blake||6-0 6-3 6-4|
|2007||Beat David Ferrer||6-2 6-3 6-2|
|2010||Beat Rafael Nadal||6-3 3-6 6-1|
|2011||Beat Jo-Wilfried Tsonga||6-3 6-7 (6-8) 6-3|
|2012||Lost to Novak Djokovic||7-6 (8-6) 7-5|
The Australian Open champion earned a fourth match point in the decisive tie-break but could not return a good serve, and Federer made him pay with a nerveless drop volley on his first match point.
"I got lucky," said a clearly relieved Federer. "Stan played better from the baseline and that usually does the job on this court. But I kept fighting.
"It's tough [on Stan] but I'm thrilled to be in another final in London."
Federer's deft winner brought an end to the longest, and by far the most entertaining, match of the week at the O2 Arena at two hours and 48 minutes.
"The final is 6pm tomorrow, which is good it's not earlier than that, so at least it gives me the chance to sleep in in the morning," added Federer.
Federer's deft winner brought an end to the longest, and by far the most entertaining match of the week, which kept the 17,000 spectators at the O2 Arena gripped throughout.
There was brilliant ball-striking from both men and controversy, as Federer argued with umpire Cedric Mourier after an over-rule in the third set which looked as if it had derailed his hopes.
Wawrinka began in spectacular fashion, breaking twice in the first set and holding off a resurgent Federer for 11 games in the second.
With a tie-break in sight, the pressure finally told and Federer broke to love thanks in part to a woeful Wawrinka smash that betrayed his nerves.
Federer appeared to be on the charge, only to be knocked off course by a dispute with umpire Mourier.
A Wawrinka backhand flew wide - later confirmed by Hawkeye - on the opening point of the final set, but Federer apparently did not hear Mourier over-rule his line judge.
It was only two points later, when Mourier announced the score was 0-40 and not 15-30, that Federer realised the situation and approached the chair.
There was nothing that could be done, however, and a flustered Federer hammered a forehand over the baseline to lose the game.
"I couldn't believe it that he wouldn't ask me more clearly because it was clearly a very close call," Federer said.
"I still don't know if it was in or out. I just don't quite understand how he cannot be louder."
Wawrinka still faced a considerable task to keep hold of his advantage all the way to the finish line but got within a point four times, only to fall agonisingly short of only a third win over his illustrious compatriot in 17 attempts.
"A tough match like that, I think there's only a few points that makes the difference," Wawrinka said.
"I was playing great tennis. I'm really happy with the way I was playing, but I had a big opportunity in the third set."