British number two Dan Evans produced a grandstand finish to defeat Italy's Andrea Vavassori and progress to the semi-finals of the Grand Prix Hassan II in Marrakech.
The 32-year-old - who ended a six-match winless streak by beating Alexei Popyrin in the second round - prevailed 6-3 7-5 in one hour and 48 minutes thanks to a remarkable second-set turnaround.
Starting as he meant to go on, Evans broke Vavassori's serve in the opening game before beating away two break points for the Italian to hold for a 2-0 lead, and neither player carved out many openings henceforth.
However, Vavassori was broken again in a breathtaking ninth game, wasting six opportunities to cut the deficit down to 4-5 and ultimately losing the first set on a double fault.
Nevertheless, the world number 201 found a sixth gear in the second set, breaking Evans to love for a 3-2 lead and subsequently moving one game away from taking the match to a deciding third set.
At 5-3 up, though, Vavassori suffered a calamitous collapse, as an inspired Evans broke the Italian twice more during a four-game winning streak to seal his spot in the final four.
Evans will now take on the Netherlands' Tallon Griekspoor or Spain's Roberto Carballes Baena in his first ATP Tour semi-final since the San Diego Open in September.