Roger Federer was taken the distance in five gripping sets by Serbian Janko Tipsarevic before winning his 17th consecutive match at the Australian Open to scrape into the fourth round on Saturday.
The world number one had to fend off a huge challenge from the 49th-ranked Tipsarevic before claiming a fighting 6-7 (5/7), 7-6 (7/1), 5-7, 6-1, 10-8 victory in four hours 27 minutes.
The epic win set Federer up with a fourth round encounter with either Argentine 21st seed Juan Monaco or 13th Czech seed Tomas Berdych on Sunday.
Federer is chasing his fourth Australian title and 13th Grand Slam victory and reached the fourth round at the season-opening major for the seventh successive year.
But it was a mighty struggle for the Swiss, who dropped sets for the first time in this year's tournament after becoming the first man since Bjorn Borg at the 1980 French Open to win a slam title without dropping a set here last year.
The last time Federer was taken to five sets at the Australian Open was against German Tommy Haas in the fourth round at the 2006 tournament.
It improved his five-set record to 11-10 and his Australian Open record to 39-5.
Federer now has beaten Tipsarevic in their two meetings after a straight sets win for Switzerland in the Davis Cup two years ago.
He has been unrivalled as world number one since February 2004 and has won three of last year's four Grand Slams for the third time in four years.
But he comes into the Australian Open for the first time since 2004 Wimbledon with his top ranking under threat.
He could lose the position he has held with a record 207 consecutive weeks if he fails to reach the semi-finals and world number two Rafael Nadal goes on to win the Australian title.
Federer looked out of sorts early and made uncustomary unforced errors as he broke Tipsarevic in the eighth game only to be immediately broken back and taken to a tiebreaker.
Tipsarevic clinched the tiebreaker with a forehand on the line and fought off break-point opportunities in two service games before the match went to another tiebreaker.
This time the top seed reeled off two mini-breaks to claim the tiebreaker 7-1 and level the match.
Tipsarevic was niggling Federer with his constant Hawkeye challenges and the pair exchanged service breaks early in the third set before the Serb grabbed the crucial break in the 11th game when the Swiss made some forehand errors.
He held three set points and went to a two sets to one lead when Federer netted a backhand.
Federer broke Tipsarevic's serve twice to seize control of the fourth set and take the match into a fifth.
Tipsarevic courageously fought off two break points in the fifth game as Federer pressed hard for the crucial breakthrough in the final set.
But the Serb resolutely held serve and kept the pressure on Federer to hold his serve and avoid defeat.
The big breakthrough came in the 17th game when Federer broke Tipsarevic's serve on his second break point as the Serb's volley was forced into the net.
Federer served out to 40-15 and claimed it on his second match point when Tipsarevic netted a backhand.