Top seed Djokovic appeared affected by a steady breeze in the Qatari capital, which did not prevent Karlovic, the six-foot 11-inch, 35-year-old from taking his aces total to 67 in three matches.
Djokovic was nevertheless three times within two points of winning the match in the second set tie-breaker, before dropping serve for 3-4 in the final set as a visibly encouraged Karlovic came up with some fine forehand winners.
He never looked likely to make a break back, eventually settling instead for congratulating Karlovic who claimed a second win over the world number onwe to add to his 2008 Madrid Masters victory.
"I was feeling good even though it was windy," said Karlovic. "I know he wasn't able to show his full range (of shots) because of the wind.
Also Read
True, Djokovic had been suffering from a fever prior to the tournament and had considered pulling out, but by the time he had dismissed Dusan Lajovic and Sergiy Stakhovsky for the loss of only six games in four sets he seemed to have recovered well.