Roger Federer survived a huge fright to squeak past unseeded Gilles Simon 6-2 6-3 4-6 4-6 6-3 and reach the third round of the Australian Open on Wednesday.

Federer had lost both his previous two meetings against Simon, but the 16-times grand slam winner had the measure of the Frenchman on a chilly night in Melbourne -- just.

Hopefully we won't play each other anymore, defending champion Federer said in a courtside interview. I was stressing out (at two sets all) obviously. I hoped he wouldn't play so well in the fifth, you hope he gets tired.

Today I got lucky. I was happy I won and I'm still in the tournament.

I really enjoyed myself out here tonight, added Federer, perhaps a little untruthfully after twanging 53 unforced errors, many of them horribly shanked forehands.

Federer caught fire early, the Swiss master ripping a forehand down the line to break in the third game and dictate the tone for the first two sets.

With a tormented Simon stalking along the baseline between points cursing his misfortune, it looked all but over after 68 minutes of one-way traffic.

But Simon, who won in Sydney in the run-up to the year's first grand slam, bravely clawed his way back onto level terms as Federer's magic suddenly deserted him.

Federer, tension etched all over his face, demonstrated nerves of steel, however, just when it looked as though Superman had left the building.

The 29-year-old, who holds an astonishing 165-0 record after winning the first two sets, threaded a forehand down the line to break for 4-2 in the fifth set.

With wife Mirka unable to watch after frittering away his first four match points, Federer finally sealed victory by blasting his 11th ace into the corner after a tortuous three hours and 14 minutes.