The match clock hit 5 hours with the score 2-2 in the fifth. Nadal won the next point and Djokovic started to stumble slightly, unsteady on his feet.
Nadal held that game without losing a point and then broke Djokovic for a 4-2 lead.
The turning point came in the next game, when Nadal had an open court but knocked a backhand volley wide down the line. He challenged the call, but the ball was clearly out. Instead of being up 40-15 and one point from a 5-2 lead, the game score became 30-30.
Djokovic found energy again and got a break point with a backhand that forced an error from Nadal. He pounced on a Nadal second serve to convert the break as the match clock ticked to 5:15, confirming it as the longest match in the history of the Australian Open. Nadal had that record, at 5:14, in his five-set semifinal win over fellow Spaniard Fernando Verdasco in 2009.
This match had already long surpassed Mats Wilander's win over Ivan Lendl at the 1988 U.S. Open, in 4:54, as the longest final in the terms of duration.
Djokovic started to look better physically and Nadal started to make some unforced errors, giving the Serbian some extra seconds between points to get his heavy breathing under control. After getting back on serve at 4-4, Djokovic kissed the crucifix around his neck twice.
With Nadal serving, the pair engaged in a 31-shot rally that Nadal finally won when Djokovic committed a backhand error. The Serb fell flat on his back on the court, fully stretched out, arms over his head, while Nadal doubled over on his side of the court, hands perched on his knees.
It appeared Djokovic was ready to throw in the towel, but he said he never thought about staying down.
"At that point I was just thinking of getting some air and trying to recover for next point," he said. "Thousand thoughts going through the mind. Trying to separate the right from wrong. Trying to prioritize the next point. I'm playing against one of the best players ever — the player that is so mentally strong. He was going for everything or nothing."
When Djokovic got the break to go up 5-4, the Serbian fans jumped up with their flags and screamed while the rest of the crowd sat in stony silence.
After kissing the crucifix around his neck repeatedly in the later games, Djokovic openly prayed out loud and looked upward as he got within points of sealing his victory.
"I was trying find every possible help and energy that I possibly can," he said. "It paid off I guess."
Despite winning the French Open, Rafael Nadal will be seeded merely No. 5 at Wimbledon, opening the prospect of a quarterfinal with Roger Federer, Novak Djokovic or Andy Murray.
Scenes from Down Under
Check out the best images from the 2013 Australian Open.
The best of Wimbledon
The best images from the Grand Slam tournament at the All-England Club.
French Open 2012: Top 10 Shots
June 10, 2012: John McEnroe, Ted Robinson, and Mary Carillo look back at the Top Ten best moments from the 2012 French Open.