Defending men's champion Roger Federer finally defeated his nemesis Gilles Simon although it took him five demanding sets to reach the third round of the Australian Open.

Federer faced a familiar problem on Wednesday night, a tricky second-round opponent against whom he doesn't match up well, and against whom he had lost twice. Frenchman Gilles is one of only three men on the tour with a winning record against him.

After breezing through the first two sets, the 16-time Grand Slam champion dropped the next two sets and found himself in a dogfight against unseeded Simon before finishing off a 6-2, 6-3, 4-6, 4-6, 6-3 victory on his fifth match point.

"I'm happy I survived a scare like today; it's not the first time," he said.

"It does happen. You just try to stay calm even though I'm not playing for much. He's playing for the huge upset, and I'm just trying to get through."

"The thing against Gilles, victory is in my racquet because I'm the aggressor," the Swiss star said.

"He let's me play and he likes to defend, so I like that kind of a match up where I control if I'm going to win or lose.

The No. 2 seed moves into the third round, where he'll face Xavier Malisse of Belgium.