Novak Djokovic Factbox | Match in Pics
The epic final lasted five hours and 53 minutes.
Djokovic, who won the title at Melbourne Park in 2008 and 2011, has now won five Grand Slam titles in total and continues his recent domination over the Spaniard, having beaten him in their last seven meetings, all in finals.
The Serbian captured the decisive break at 5-5 in the fifth set in a frenzied atmosphere at Rod Laver Arena.
Crossing himself and muttering prayers at the heavens, Djokovic slammed a cross-court forehand winner on the first match point and collapsed to the ground in ecstasy after the five-hour 53 minute tussle.
The win gave top seed and 2008 champion Djokovic his fifth Grand Slam title before his 25th birthday.
The final broke the record as the longest match in tournament history when it hit 5hr 15min.
The match was also the longest Grand Slam final on record, outstripping the 1988 US Open final between Mats Wilander and Ivan Lendl, which lasted 4hr 54min.
The previous longest Australian Open match was the 2009 semifinal between Nadal and Fernando Verdasco, which lasted 5hr 14min.
Nadal saved three break points in the eighth game of the fourth set then waited out a 10-minute rain break before he levelled the match by taking the fourth set 7-6.
Nadal had been facing the distinct possibility of defeat within five minutes when he was reduced to 0-40 while trailing 3-4 in the set but produced a fantastic backhand pass and three massive serves to claw his way back into the match, which prompted the crowd to break into tumultuous chants of "Rafa".
The players were then forced off the court as officials shut the roof on Rod Laver Arena after rain swept across central Melbourne and the ball boys and girls scrambled around on their knees with towels to dry the court.
Nadal then fed off the crowd that had swung behind him and, after seemingly been down and out returned to his fist pumping, competitive best and took the tiebreak 7-5 to send the match into a decider.
Djokovic raced through the third set to take a 2-1 lead as he began to wear the Spaniard down and seized the set 6-2.
Djokovic set the tone when he blasted through the first game and held serve to love and ,while he had no break points on Nadal's first service game of the set, the Spaniard was forced to battle as the Serb forced three deuce points.
The world number one continued the pressure on Nadal's serve in the fourth game when he sealed the important break and then consolidated for a 4-1 lead when he again held his own serve to love.
Djokovic, who was stepping inside the court and attacking Nadal's top-spin forehand while compelling the Spaniard to play from deep behind the baseline, again pressured Nadal on serve then held his own serve to love to take a 5-2 lead.
He sealed the set when he broke Nadal to love in the next game and the momentum had definitely swung towards the defending champion.
Djokovic only dropped two points on serve in the 45-minute third set.
Djokovic's powerful forehand finally started to find its range as he levelled the match at one-set each by grabbing the second set 6-4.
The error-ridden first set had lasted 80 minutes, just two minutes shorter than the entire women's final on Saturday, and while Djokovic discovered his rhythm in the second the set still lasted 66 minutes.
The Serb also put pressure on Nadal's serve at every opportunity and broke in the fourth game to take a 3-1 lead.
Nadal, though, had won the point of the match when he produced a stunning running backhand top-spin drive down the line that brought the crowd to their feet after a 15-shot rally that swept back and forth across the court.
Djokovic was serving for the set but was broken when he held two set points before he seized back the initiative in the next game and broke Nadal again to level when the Spaniard served his second double fault.
Nadal fought off intense pressure on his own serve from Djokovic to break the world number one twice in an error-ridden first set before he won it 7-5 after 80 minutes to take the early lead.
Djokovic suffered a slight scare in the fourth game when he went over on his right ankle after attempting a slide, and went down to his haunches before he began to flex and roll it in circles at the end of the game.
Both players failed to really settle or stamp their authority on the match, though Djokovic had more opportunities to break the Spaniard's serve.
After breaking in the fifth game Nadal had to fight off Djokovic twice before the Serb broke in the eighth game, though Nadal seized back the advantage in the 11th game and sealed the opener on his third set point when a backhand return floated long.