MELBOURNE, Australia (AP) Rafael Nadal dropped to his knees, clasping his hands tightly and appearing to be on the verge of tears as he celebrated a win at the Australian Open.

The 14-time Grand Slam champion has played some epic matches on Rod Laver Arena, including an almost six-hour final. This was a comeback second-round win over U.S. qualifier Tim Smyczek, a player ranked No. 112 who had never beaten a top 10 player.

But the 6-2, 3-6, 6-7 (2), 6-3, 7-5 win Wednesday was a breakthrough of sorts for the third-seeded Nadal, who came into the first major of the season after playing just four tournaments since Wimbledon due to a right wrist injury and appendix surgery.

At the end of the third game of the third set, Nadal called for assistance and was given medication for stomach pain. At times in the match he was doubled over in pain, seemingly on the verge of sickness or exhaustion.

Yet he pulled through, earning the only break of the fifth set in the 11th game and then serving it out - after wasting three match points - in 4 hours, 12 minutes.

Smyczek pushed Nadal to the limits, and played fair. When a spectator screamed out as Nadal tossed the ball for his serve at 30-0 in the last game, the American insisted Nadal replay the serve.

''Very tough night for me. Just first of all I want to congratulate Tim - he's a real gentleman,'' Nadal said. ''What he did in the last game is ... not a lot of people will do something like this at 6-5 in the fifth set.''

The highly-ranked seeds didn't get it entirely their way on day three.

No. 2-ranked Maria Sharapova saved two match points before escaping with a 6-1, 4-6, 7-5 second-round win over fellow Russian Alexandra Panova, a qualifier ranked No. 150.

Roger Federer dropped the first set and needed medical advice on his sore right pinkie finger - scolding a camera operator by saying ''Do you have to be that close?'' - before beating Simone Bolelli 3-6, 6-3, 6-2, 6-2 to reach the third round.

Sharapova made 51 unforced errors as she went for the lines, but kept swinging hard and saved some of her best ground strokes for when she needed them.

''I'm just happy to get through - I was one point away twice today from being out of the tournament,'' said Sharapova, who started the season by winning the Brisbane International title. ''I was not playing my best tennis today. I think she played a pretty inspired match.''

She faced match point twice in the 10th game of the third set, stepping into a return winner on a weak second serve and later ripping a forehand winner deep into the corner against Panova, who entered the Australian Open without a single match win at five previous majors.

The only Grand Slam champion remaining in her half of the draw, Sharapova next plays No. 31 Zarina Diyas.

In a late match that started just before midnight because of the extended Nadal five-setter, French Open finalist and third-seeded Simona Halep beat Jarmila Gajdsova 6-2, 6-2.

No. 7 Eugenie Bouchard, who reached the semifinals or better at three of the four majors in 2014, needed just 54 minutes to beat Kiki Bertens 6-0, 6-3. Also advancing were No. 10 Ekaterina Makarova, No. 21 Peng Shuai and No. 22 Karolina Pliskova.

Federer was bothered by pain in his right hand, and took a medical timeout after the first set, before recovering to beat No. 48 Bolelli.

''It felt like a bee stung me. I was like `This can't be possible - I never had this pain before.' It was disturbing me,'' Federer, a four-time Australian Open champion, said. ''I knew that to tape it wasn't an option.'' Even after the match, he couldn't identify the cause of his pain.

Three-time Australian Open finalist Andy Murray wasn't bothered by anything, particularly the parochial crowd, as he beat Melbourne's Marinko Matosevic 6-1, 6-3, 6-2.

Seventh-seeded Tomas Berdych advanced along with No. 10 Grigor Dimitrov, No. 14 Kevin Anderson and No. 24 Richard Gasquet.

Seven of the men's seeds were defeated - among them, 2006 Australian Open finalist Marcos Baghdatis beat No. 20 David Goffin and Bernard Tomic had a late 6-7 (5), 6-4, 7-6 (6), 7-6 (5) win over No. 22 Philipp Kohlschreiber.

Australian teenager Nick Kyrgios - who was a wild card ranked No. 144 when he beat Nadal in the fourth round at Wimbledon last year - beat No. 23 Ivo Karlovic in a four-set match featuring a combined 65 aces, 40 by the loser.