World number one Djokovic started the encounter slowly and Nadal took full advantage to break at 3-2. However, Djokovic broke back at the earliest opportunity to level up the score at four games all.
With the set looking to be heading for a tie-breaker, Nadal broke Djokovic's serve at the second attempt to take the set 7-5.
However, Djokovic responded positively and took the second set 6-4 with a late break of Nadal's serve.
The third set also went the way of the Serbian, who broke Nadal on two occasions to wrap up a 6-2 success to put him within one set of the title.
Both players traded serves during the fourth set, with Nadal being made to work hard to keep himself level with Djokovic. On one occasion, the Spaniard fought back from 0-40 down on his own serve to take the game.
At 4-4, the pair were forced to leave the court while the roof was closed at the Rod Laver Arena because of persistent rain.
The trend continued when the players returned to the court, as the set headed into a tie-break.
Having claimed an early break, Nadal held his nerve to win the tie-break 7-5 and take the match into a fifth-set decider.
Djokovic's lengthy semi-final match against Andy Murray appeared to catch up with him in the deciding set and he was eventually broken by Nadal, who took a 4-2 lead in the set.
Two-time Aussie Open champion Djokovic refused to be beaten though and broke back at the first time of asking to level up the match at four games apiece.
He then went on to break Nadal once again to open up a 6-5 advantage, before going on to serve out for the championship.
The match, timed at almost six hours, was the longest in the history of the Australian Open.