Djokovic comfortably won the first set 6-4 with two break points. But the Austrian found his way back into the match after the Serbian started struggling physically from the middle of the second set. The second and third set went Thiem’s way 6-4, 6-2.
The Serb fought back to win the fourth set 6-3 and the fifth 6-4 to deny the Austrian his first Grand Slam.
In contrast, Djokovic has now bagged eight titles in Australia and 17th major titles overall, two shy of Rafael Nadal’s haul of 19 and three shy of Roger Federer’s 20.
The indomitable Serb stretched his unbeaten streak this season to 13.
Victory put him alongside his fellow legends as only the third man in history to win eight or more titles at the same Slam after Nadal (12 at the French Open) and Federer (eight at Wimbledon).
It also ensured he will once again be world number one when the new rankings are released on Monday, surpassing Nadal. Federer remains third with Thiem moving up a place to a career-high fourth.
But it wasn’t easy with the Serb looking lethargic and out for the count in sets two and three before regaining his mojo after a medical timeout to grind down the talented Thiem.
Djokovic had never before won a Slam final in seven previous attempts when finding himself two sets to one down.
The Serb, 32, was the overwhelming favourite, but the supremely fit and fast Thiem, 26, always had the weapons to trouble him, which he deployed successfully for much of the match, taming his serve and unleashing some explosive groundstrokes.
It was a nerveless start from Djokovic, who comfortably held then put big pressure on the Thiem serve, with a forehand into the net giving him an immediate break and a psychological edge after some monster rallies.
Thiem, though, is as strong mentally as he is physically and he finally got on the scoreboard after another tough service game.
And against the run of play, with Djokovic seemingly in control, he broke back, unleashing pinpoint groundstrokes to make the most of some loose Djokovic shots.
But the world number two was unrelenting, breaking again as Thiem served to stay in the set, with the Austrian sending down his first double fault of the match at the crucial moment.
Remarkably, a rare Djokovic double fault handed Thiem a break to go 2-1 up in set two with the courageous Austrian refusing to go away.
The Serb was getting frustrated, looking at his coaching box and pointing at his head.
He refocused and once again began attacking the Thiem serve, breaking back for 4-4, pumping his fists when the fifth seed sent a backhand wide.
But two time warnings on his serve in the next game rattled Djokovic and he was broken again, with the Serb losing his cool by patting the umpire’s foot at the changeover.
He had words with the official before Thiem served out the set — the first the Serb had dropped in an Australian Open final since 2015.
Djokovic looked dejected and was immediately broken twice in set three as Thiem raced to a 4-0 lead, having won six games in a row with Djokovic imploding.
The Serb was heard telling a trainer he was tired and after losing the set, he went for a medical timeout.
He came back and the fourth set went with serve until a Thiem double fault handed the Serb two break points and he converted to regain control, serving out the set with an ace.
Djokovic drew on all his experience to force another break in the deciding fifth set to take a 2-1 lead and kept his foot on the gas to claim an eighth crown from the last 13 Australian Opens.