Cilic was on the verge of a third loss in the Queen’s final when Djokovic held a match point in the second set.
But the world number six survived that threat and then stormed back from 4-1 down to take the second set tie-break.
Inspired by that escape act, Cilic powered through the deciding set to leave Djokovic shell-shocked as he won the Wimbledon warm-up event for the first time since 2012.
“It was a special win for me because last year I had a match point and didn’t convert it,” Cilic said.
“It was a tough match but I have waited six years to get my hands on this trophy.”
Djokovic tried to stay upbeat, saying: “I have to congratulate Marin on a fantastic week. He deserved to win and came up with some big shots.
“It’s a tough loss for me. But I have to see the positive because I haven’t played a final in almost a year.”
It was a cathartic moment for Cilic who had finished as the runner-up at Queen’s and Wimbledon last year.
Both defeats were painful for Cilic, who lost a final set tie-break against Feliciano Lopez at Queen’s and broke down in tears during his injury-plagued Wimbledon loss to Roger Federer.
Former US Open champion Cilic also lost the 2013 Queen’s final and experienced fresh heartache against Federer in this year’s Australian Open final.
But he banished his nearly-man tag with a gutsy comeback to claim only his second win in 16 attempts against Djokovic, clinching his 18th career ATP title and his first since Istanbul last year.
Winning the longest final in Queen’s history — at two hours and 57 minutes — was just reward for Cilic’s superb week on the lawns of Barons Court, which banked him a cheque for £413,601 ($548,764).
For Djokovic, there was only frustration at his failure to finish off Cilic and win his first title since the grass-court tournament at Eastbourne 12 months ago.
Djokovic, a three-time Wimbledon winner, had hoped his 99th career final — and first for a year — would be a significant landmark in his bid to return to the top after a wretched run.
Instead, the Serb heads to Wimbledon with fresh doubts about his ability to recapture the transcendent form that made him a 12-time Grand Slam champion.
– Under duress –
Djokovic is a lowly 22nd in the ATP rankings after an embarrassing French Open quarter-final defeat against Italian journeyman Marco Cecchinato earlier this month.
He hasn’t earned a major title since competing his career Grand Slam by winning the 2016 French Open.
Dogged by rumours he no longer has the motivation to return to the top, the 31-year-old’s error-strewn collapse from such a commanding position will be especially troubling.
Djokovic was under duress early on as Cilic earned five break points in a marathon seventh game, only for the Serb to wriggle out of trouble on each occasion.
Despite spending much of the set in damage-limitation mode, Djokovic snatched the set.
Firing some superb returns, he converted his third set point when Cilic netted a backhand.
But crucially, Cilic saved a match point at 4-5 in the second set, with a thunderous service winner setting the stage for a thrilling tie-break.
Djokovic raced into a 4-1 lead in the breaker.
Yet, with the title in his grasp, he lost his composure, nervously double-faulting as Cilic rattled off six successive points to level the match.
Cilic produced the knockout blow in the final set with a brilliant winner on the run to break in the eighth game, earning a thumbs up from Djokovic that effectively signalled his surrender. DM