London - Roger Federer set up a mouthwatering semi-final with Rafael Nadal at the ATP World Tour finals after battling past Juan Martin del Potro in their Group B shoot-out on Saturday.
The Swiss seemed to spend most of the match fighting from behind but showed the grit of a true champion to topple the Argentine 4-6 7-6 (7/2) 7-5 at London's O2 Arena.
Victory meant he qualified for the last four as group runner-up to defending champion Novak Djokovic who will face Federer's fellow Swiss Stanislas Wawrinka in Sunday's other semi-final.
Federer had only once fallen in the round-robin phase of the season-ending tournament in 11 previous appearances and never since the tournament switched to London in 2009.
However, Del Potro looked favourite to tarnish that proud record as he moved a set and a break ahead.
Federer produced a stirring fightback from 5-1 down in the opening set only to fall short but hit back from a break in the second to level the contest with a commanding tiebreak.
The level of Federer's game fluctuated throughout the match and it dipped again at the start of the deciding set when a netted forehand gave the powerful Argentine a 2-0 lead.
Again Federer responded to a deficit with some of his most forceful tennis and Del Potro's erratic forehand gifted the six-times champion two cheap points in the fifth game to get the set back on serve.
With the crowd roaring on the six-times champion he broke Del Potro's serve to lead 6-5 and then completed his second victory over Del Potro in consecutive weeks with an ace.
Results from the sixth day of the ATP World Tour Finals on Saturday (x denotes seeding):
Roger Federer (SUI x6) bt Juan Martin del Potro (ARG x4) 4-6, 7-6 (7/2), 7-5
Novak Djokovic (SRB x2) v Richard Gasquet (FRA x8)
Ivan Dodig/Marcelo Melo (CRO/BRA x3) bt Aisam-Ul-Haq Qureshi/Jean-Julien Rojer (PAK/NED x5) 7-5, 3-6, 11/9 in match tie-break
Bob Bryan/Mike Bryan (USA/USA x1) v Mariusz Fyrstenberg/Marcin Matkowski (POL/POL x8)