(CNN) -- World No.1 Novak Djokovic beat Rafael Nadal in the longest final in grand slam history to retain the Australian Open title in Melbourne.
Djokovic has now won four out of the last five grand slams, beating Nadal in three successive finals, to underline his domination of men's tennis, but it took him seven minutes short of six hours to see off the Spaniard in an epic final.
After hitting the winning shot for a 5-7 6-4 6-2 6-7 7-5 victory, Djokovic lay on his back in triumph before ripping off his shirt, pumping his chest in triumph as he walked to the players' box to embrace his coach.
The match ended at 1.40 a.m. local time Monday and was 59 minutes longer than the previous record, the 1988 U.S. Open final between Mats Wilander and Ivan Lendl.
It also broke the record for the longest match at the Australian Open, the five hours 14 minutes set by Nadal and Fernando Verdasco in 2009.
"Rafa, you're one of the best players ever," Djokovic said at the trophy presentation.
"We made history tonight, and unfortunately there couldn't be two winners. But I wish you all the best for this season and I hope that we will have many more matches like this and many more finals."
World No. 2 Nadal told the crowd: "I will never forget this match. Even though I lost, it was something really special for me."
The Serbian was also involved in a near five-hour long battle to beat Britain's Andy Murray in the semifinals and when he fell behind after an opening set lasting 80 minutes, all the omens pointed to a Nadal victory.
But the 24-year-old from Belgrade was not to be denied even after a stirring recovery which saw his opponent take the fourth set on a tiebreak to force a decider on the Rod Laver Arena at Melbourne Park.
It was a bitter disappointment for Nadal who, having beaten arch-rival Roger Federer in Thursday's semifinal, was bidding for his 11th grand slam title.
He had only lost once after winning the first set of a grand slam match since 2007, but in the end he succumbed to Djokovic's sheer persistence.
Two breaks of service to one saw the Mallorcan claim the opener, but Djokovic broke in the fourth game of the second set to recover his composure.
However, serving to level the match, Djokovic played a sloppy game and Nadal closed to 5-4.
But Nadal showed his first sign of fallibility in the next game as he fell behind and facing set point contrived to double fault.
With the impetus now in his favor, Djokovic dominated the third set, running Nadal from side to side and taking it 6-2 with two breaks of service.
Djokovic forced three break points on Nadal's service, leading 4-3 in the fourth, but the World No.2 showed his famous fighting qualities by retrieving them and holding for 4-4.
As the game was completed, a heavy rain shower caused a break in play as the roof on the arena was closed.
When play resumed it was Nadal who came out the sharper and in the tiebreak which followed he upped his game to prevail seven points to five, pumping the air in trademark style as he leveled at two sets all.
He looked set to complete the turnaround when he broke Djokovic to lead 4-2 in the decider.
But it was not be be as the break was retrieved with Djokovic then looking the stronger.
He finally broke through to serve for the match at 6-5.
Still he was forced to save a break point, but he closed out the match on the first championship point to claim the winner's check for $2.4 million.