World number one Novak Djokovic suffered a major scare against world number 110 Mischa Zverev before fighting back to reach the semi-finals of the Shanghai Masters.
The Serbian top seed came back from a set and a break down to win 3-6 7-6 (7-4) 6-3 in two hours 20 minutes.
He will play Spain's Roberto Bautista Agut in the last four.
British number one Andy Murray plays 11th seed David Goffin in the quarter-finals later on Friday.
Djokovic, 29, made a number of uncharacteristic errors against Germany's Zverev - including two double faults and 14 unforced errors in a nervy 62-minute second set - but was far more comfortable in the decider, breaking early as the qualifier ran out of steam.