World number one and top seed Djokovic would have been expected to see off the challenge of Karlovic and seal his place in the last four, and he looked on course to do that after edging the first set.
However, Karlovic battled back to level up the match following another tie-break and the giant Croatian then stunned Djokovic by taking the deciding set to clinch a 6-7 (2/7) 7-6 (8/6) 6-4 victory.
Rather than looking for excuses for his defeat, though, Djokovic preferred to heap praise on the big-serving Karlovic – who earlier this week became only the third man to record 9,000 aces – while also describing his own experience in Doha as “really enjoyable”.
“(He is) one of the best all-time servers in tennis history,” the Serbian said on www.atpworldtour.com.
“He served very well. You could expect that. I was coming into the match knowing that I will have very, very few chances.
“I was hoping that these conditions and the wind will give me some second serve opportunities. It didn’t happen this way.”
Djokovic added of his time in Doha: “I had plenty of matches, singles and doubles, I think six in total, so I think it’s good.
“Obviously I wish I could go further at least in singles, but it’s the way it is. It was a good week. It was a really enjoyable experience.”
Karlovic, who was facing Djokovic for the first time in seven years, will now meet David Ferrer for a place in the final.
The fourth-seeded Spaniard had few problems seeing off Germany’s Dustin Brown 6-2 6-2.
The other semi-final pits Czech Tomas Berdych and Italian Andreas Seppi against each other after both progressed through their last-eight matches in straight sets.
Berdych, the third seed, downed 2013 champion Richard Gasquet 6-2 6-1 while Seppi defeated Ivan Dodig 7-5 6-4.