Roger Federer hopes being the underdog can play to his advantage when he meets Rafael Nadal in the semi-finals of the Barclays ATP World Tour Finals today.

The six-time champion faced a straight shootout with Juan Martin del Potro at London's O2 Arena for second spot behind Novak Djokovic in Group B. Of all Federer's qualities, it was his ability to battle that served him the best as he fought back from a break down in the second and third sets to win 4-6, 7-6 (7/2), 7-5. That set up a 32nd meeting with his old rival Nadal, who had the advantage of a day off yesterday.

History certainly favours the Spaniard, who leads their head-to-head 21-10 and has won 13 of their last 17 matches, including all three this year. While Federer has endured his worst season for more than a decade, Nadal has returned from serious injury to win 10 titles and reclaim the No 1 ranking.

The main source of encouragement for Federer is that he was won all four of their previous matches indoors, including both times they have met at the O2.

Federer said: "I just feel like I need to look at it more as being an underdog a little bit because of circumstances, because of my year, because of his year. Maybe that free swinging is what I need to do a little bit more tomorrow.

"We know each other that well. He's going to do exactly what he needs to do, I'm going to try to do what I need to do. Hopefully it's going to match up good for me. If not, he deserves it. He's had a wonderful season."

For most of the clash with Del Potro it looked like it would be the Argentine who would be going through to meet Nadal. Federer's forehand was a liability as he lost five of the first six games but he found his form in time to make it a close first set, missing two chances to level at 5-5.

Del Potro broke in the third game of the second set to take a stranglehold on the match but a run of 12 straight points got Federer back on track and he played an impressive tie-break.

The Swiss gave back the initiative when he was broken again at the start of the third set but once more he fought back and a break to lead 6-5 put him ahead for the first time in the match.

Del Potro had one chance to force a tie-break but could not take it and Federer clinched victory with his 10th ace.

The comeback was another sign of Federer's improving confidence, with three of his four victories over top-10 players this year having come in the last eight days.

Asked how he felt at 3-0 down in the decider, Federer said: "I fought back the whole match. I was thinking, 'Here we go again'. I was really getting angry at myself, how could I play a loose game, why is this happening? Because of the last few weeks probably I stayed relatively calm inside because I had a lot of ups and downs throughout the matches in Basel and in Paris, then again here.

"I wasn't in many of Juan Martin's service games so I felt like probably I would get one more chance to break back. It's exactly what happened. Once on even terms, I was able to play a little bit more freely. It was a great finish. I was very happy. To get the victory was a great feeling."

The Argentine was frustrated he could not take his chances against Federer, but said: "I think I had a great season. For this year my goal was to try to play at the same level as the top guys. I am the only player who beat all of them this season, which means something to me."

Today's other semi-final pits defending champion Djokovic against Stanislas Wawrinka, who will be looking to end a 13-match losing streak against the Serbian.

The pair have played two of the best matches of the season, with Djokovic winning five-setters at the Australian and US Opens.

Wawrinka has made the last four on his debut, and Federer said of his countryman: "I don't know if I'm more excited that I won or we're both in the semis. It's historic."

In the dead rubber last night, Djokovic gained his 70th win of the season by beating Richard Gasquet 7-6 (8-6), 4-6, 6-3.