Roger Federer came from two sets down against Tommy Haas to reach the quarter-finals of the French Open and keep alive his hopes of winning the one grand slam title to have eluded him as he chases down Pete Sampras's record of 14 majors.

Sunday's stunning fourth-round defeat by Sweden's Robin Soderling of Rafa Nadal, the world No1 and winner at Roland Garros for the last four years, has opened the way for Federer to become only the sixth player in tennis history to win all four slams, and to equal Sampras's total. But the nerves were there for all to see on the Philippe Chatrier court before he won 6-7, 5-7, 6-4, 6-0, 6-2.

Federer served superbly in the opening set, not dropping a point, but then it all began to go wrong for him in the tie-break. Thereafter Federer's forehand broke down almost completely and there seemed a real possibility that the new tournament favourite might, for the first time since he was beaten by Gustavo Kuerten here in 2004, 20 slams ago, fail to reach the semi-finals or better.

Federer, the runner-up at Roland Garros for the last three years, losing on each occasion to Nadal, fretted and fumed. He had beaten Haas in eight of their previous 10 meetings, including the past seven, but this was sheer torture.

Haas had only once previously reached the fourth round at the French Open, his greatest slam successes being on the hard courts in Australia, where he has reached three semi-finals, losing to Federer over five sets in 2006.

Five times the German had already lost from being two sets up, and this must surely have been in Federer's mind, the Swiss having come back from two sets down on four previous occasions. Once he had won the third set the momentum switched almost completely, with Haas making more and more unforced errors.