It seemed Murray was on track to reach his third Australian Open final when he led two sets to one but Djokovic sped through the fourth and then edged a dramatic fifth as Murray, having hit back from 5-2 down to level at 5-5, dropped his serve to lose 6-3, 3-6, 6-7 (4/7), 6-1 7-5.
It was heartbreaking for Murray who will no doubt look back on that fourth set with some anguish. Overall though it was compelling tennis, with the two old friends regularly breaking each other’s service games.
World No.1 Djokovic was first to break serve when a Murray double fault handed the Serbian a 3-1 lead and he always stayed ahead despite Murray breaking back immediately.
Murray was still struggling to find his best tennis and Djokovic took a 2-0 lead in the second set which nearly became 3-0 but the 24-year-old from Dunblane forced an error from the Serbian before holding.
And dodging that bullet seemed to install some fire into Murray. He opened the next game with a stunning slam-dunk smash on his way to claiming it on his second break point opportunity, and he remained on the front foot with a solid service game which handed him a 3-2 lead. The pair then traded breaks for Murray to lead 5-3 and he saved two break points to win the next four points and claim the set 6-3.
Murray threatened again at 1-1, some hard-hitting from the baseline presenting him with the chance to finish the game with a smash which he converted with ease. Once again, though, Murray promptly tossed his advantage away. From 15-15, Murray served a double-fault and followed it up with a loose forehand and a long backhand as the set moved back on serve.
Djokovic held for 3-2 before two routine holds. Murray found himself under threat when serving at 3-4. Djokovic moved out to a 0-30 lead but Murray regained his composure to escape trouble.
Murray took Djokovic to deuce in the next game but the world number one clinched it to put the pressure back on the Scot. But Murray showed plenty of guts to stave off three set points and, sensing he had got out of jail, struck for 6-5.
However Murray seemed crippled by nerves at a crucial juncture and a string of errors allowed Djokovic to level for a tie-break. The momentum had seemed to swing back towards Djokovic but Murray played a solid tennis to win it 7-4 and edge two sets to one ahead.
Djokovic was not going to give up his title without a fight, though, and he came out swinging at the start of the fourth set, breaking for a 1-0 lead and again for 3-0 and then enjoyed an easy hold before Murray finally got on the board. However 1-4 quickly became 1-6 to produce a deciding fifth set.
Murray looked like he had regained his composure after the fourth-set horror show although he had to stave off three break points at 1-2, some big serving getting him out of trouble. But he could not repeat the feat when Djokovic threatened again, the Serbian moving 4-2 ahead after crushing a mid-court forehand on his second break point.
Murray forced his opponent to serve it out and it proved a crucial moment as Djokovic faltered, his serve deserting him at a critical time.
The Scot completed his comeback from 5-2 down to 5-5 with a cool hold.
And he almost broke again only for three break points to come and go.
It was to prove his final opportunity as Djokovic then broke to clinch an extraordinary match in four hours and 50 minutes.