World number one Novak Djokovic was beaten in the Qatar Open semi-finals by Spaniard Roberto Bautista Agut in Doha.
The Wimbledon champion, twice a winner of the event, lost 3-6 7-6 (8-6) 6-4.
Bautista Agut, ranked 24, took the second-set tie-break on his fifth set point and then broke in the opening game of the decider, eventually sealing victory in two hours and 35 minutes.
In Saturday’s final he faces wildcard Tomas Berdych, 33, now ranked 71, who beat Marco Cecchinato 7-6 (8-6) 6-3.
It was only the second victory in nine matches against Djokovic for 30-year-old Bautista Agut, who has never progressed beyond the fourth round of a Grand Slam.
Djokovic beat the Spaniard in four sets in last year’s French Open and he was a set up and serving at 4-3 in their latest encounter.
But Bautista Agut, winner of last year’s Dubai Championships, lost only five points on his serve in the final set and wrapped up the contest on his first match point.
In his first event since June’s Fever-Tree Championships at Queen’s, Czech Berdych, without a title since 2016, beat Italian fourth seed Cecchinato in an hour and 29 minutes.
Berdych ended his 2018 season early because of a back injury.