The seventh-seeded Croat saved a match point with an ace when trailing 6-5 in the third-set tiebreaker, then clinched the match with another ace at 8-7.
Karlovic, who won his first two ATP titles this year and earned a career-high ranking of No. 25 this week, will play either Tommy Haas or Juan Monaco in Saturday's semifinals at the Royal Tennis Hall.
Karlovic, at 2.08 meters (6-foot-10) the tallest player on the ATP tour, had 30 aces for a tour-leading 1,093 this year. Goran Ivanisevic set the record in 1996 with 1,477 aces.
Karlovic lost only four points with his serve in the first set, when his first-serve percentage was 88 percent.
Clement saved two break points in the second set at 1-1, and then broke Karlovic for the only time in the match to lead 4-3 when the Croat's forehand sailed long.
There were no service breaks in the third set.
On the second day of the St. Petersburg International Economic Forum, a plenary meeting was held, in which Russian President Vladimir Putin, French President Emmanuel Macron, Japanese Prime Minister Shinzo Abe, Chinese Vice President Wang Qishan and IMF head Christine Lagarde took part