It extends the Melbourne record he set last year, while Djokovic becomes the first man in the Open era to win slam titles across three decades.
But for much of this contest it appeared Thiem, who defeated Rafael Nadal in the quarter-finals, would be the first of the younger generation to claim a slam title.
— #AusOpen (@AustralianOpen) February 2, 2020
The 26-year-old Austrian led by two sets to one against an out-of-sorts Djokovic only for the Serbian to fight back and claim a 6-4 4-6 2-6 6-3 6-4 victory.
Djokovic, who remains unbeaten in finals on Rod Laver Arena, now has 17 slam titles, only three short of record holder Roger Federer, and will reclaim the world number one ranking from Nadal on Monday.
The trio have won the last 13 slams between them but, after Daniil Medvedev pushed Nadal to five sets in the US Open final, there is no doubt they are having to fight harder to keep the door shut.
The surprise was not so much that Thiem came close – he has been the consistent improver of men’s tennis over the last few years, while he had won four of his previous five matches against Djokovic – but that the defending champion played such a patchy match.
The 32-year-old lost his cool in the ninth game of the second set after being given back-to-back time violations, the second of which resulted in him being penalised a first serve and then broken.
On the way back to his seat he tapped umpire Damien Dumusois on the foot, saying: “You’ve made yourself famous, well done.”
It was the start of a six-game winning run for Thiem, twice a runner-up to Nadal at the French Open, that left him 4-0 up in the third set, and one game later Djokovic again called for the doctor.
He had taken a pill after the first set of his victory over Federer in the semi-finals, which had been rather forgotten amid the focus on the Swiss’ physical struggles.
Djokovic sat with head bowed and shoulders slumped but he showed signs of life at the end of the third and a break point saved in the third game of the fourth set was a crucial moment.
Just how crucial became clear as he steadied himself, found his serve again and broke through to send the match to a decider.
The odds swung firmly back in favour of the man who has been here so many times before, and he had one hand on the trophy when he broke to lead 2-1.
Thiem fought valiantly to stay within touching distance but Djokovic was nerveless serving it out, pointing his fingers to the sky in triumph.
Djokovic had played one of the finest matches of his career to beat Nadal in the final here 12 months ago, utterly crushing his great rival, and he started in a similar vein.
Thiem had to hang on by his fingernails just to stay within one break, but hang on he did and he took advantage when Djokovic came down from the mountaintop in the seventh game.
The opening set still went the way of the Serbian, though, after Thiem double-faulted on set point.
The Austrian had spoken in the build-up about having to tread a fine line between aggression and recklessness, and he was not always getting it right, particularly on his backhand down the line.
It was a key shot against both Nadal and Alexander Zverev in the semi-finals but here Thiem, who had spent nearly six hours longer on court than Djokovic on the way to the final, could not quite keep it under control.
A wild one gave a break back in the second set and, with Djokovic serving at 4-4, the momentum seemed to be with him once more.
But then came the Serbian’s loss of focus as an evening full of drama played out on Rod Laver Arena.
Djokovic received the trophy from 2005 champion Marat Safin, before saying: “I would like to start by saying congratulations to Dominic for an amazing tournament.
“It wasn’t meant to be tonight but you were very close to winning it. You have a lot of time in your career and I’m sure you will get one of these grand slam trophies – more than one.”
Djokovic also used his speech to remember his friend Kobe Bryant, who was killed in a helicopter accident last weekend.
He said: “There was some devastating things that started 2020 with huge bushfires here in Australia, conflicts in some parts of the world. One person that I considered close in my life, a mentor to me, Kobe Bryant, passed away with his daughter.
“I would like to say this is a reminder to all of us we should stick together more than ever. Of course we are part of professional sport but obviously there are more important things in life.”
After receiving the runners-up plate, Thiem said: “I would like to start with a huge congrats to Novak, amazing achievement and also to all your team.
“Unreal what you are doing throughout all these years. You and two other guys brought men’s tennis to a completely new level. I’m really proud and happy that I can compete in these times. I fell a little bit short today but I hope soon I can get the revenge.”