(CNN) -- World number two Roger Federer survived a comeback from France's Gilles Simon on his way to a hard-fought second round win at the Australian Open on Wednesday.
Defending champion Federer, who is bidding for his fifth victory at Melbourne Park, opened up a two-set lead over 34th-ranked Simon in just 68 minutes.
Simon, 26, had won both his previous meetings with Federer and mounted a fight to force the match into a fifth and final set.
However, the 29-year-old Federer dug deep to secure a crucial break of serve in the sixth game of the deciding set -- eventually sealing a 6-2 6-3 4-6 4-6 6-3 victory after nearly four hours of play.
"It's great to play against him," Federer told the tournament's official website. "I really enjoyed myself out here tonight, it's really special, and obviously I'm really happy.
"I wasn't playing poorly either to lose the third and fourth set, I really think Gilles took it to me, but you remain positive. I'm happy I won and I'm still in the tournament."
The 16-time Grand Slam winner will now face Xavier Malisse in the third round after the Belgian thrashed 25th seed Albert Montanes of Spain 6-4 6-0 6-1.
The 2008 Australian Open winner Novak Djokovic is safely through to the last 32 after a 7-5 6-7 6-0 6-2 victory over Croatia's Ivan Dodig.
World number three Djokovic won eight games in a row after losing the second set, and the Serb was pleased to be tested by a player ranked 81st in the world.
"The positive thing about this match is I was challenged," Djokovic told the official ATP Tour website.
"I was pushed to the limits in the first two sets and stayed around three, three-and-a-half hours on the court."
The 23-year-old will now face compatriot and Davis Cup teammate Viktor Troicki, who won saw off Frenchman Nicolas Mahut.
American Andy Roddick claimed a straight sets win against Igor Kunitsyn of Russia to confirm his place in the next round.
Kunitsyn had two opportunities to claim the opening set before 2003 U.S. Open champion Roddick scored a 7-6 6-2 6-3 triumph.
Roddick, ranked eighth in the world, will now face Dutchman Robin Haase, who advanced at the expense of Argentina's Juan Monaco.
Tomas Berdych avoided a repeat of his exit in the second round of the 2010 tournament as he recorded a 4-6 6-2 6-3 6-4 success against Philipp Kohlschreiber.
The Czech will face France's Richard Gasquet, seeded 28th, in the next round after he dispatched compatriot Adrian Mannarino.
Fernando Verdasco had to save three match points before he overcame Serb Janko Tipsarevic 2-6 4-6 6-4 7-6 6-0.
The Spanish world number nine will now take on Japan's Kei Nishikori after his win over Germany's Florian Mayer.