Dominic Thiem followed up his win over Roger Federer with a stunning performance in an enthralling 6-7 (5-7) 6-3 7-6 (7-5) victory over Novak Djokovic to secure his progression in the ATP Finals.
The most recent meeting between Djokovic and Thiem went the distance at Roland Garros in May, and it was the latter who triumphed again in a two-hour 50-minute classic.
After losing a 66-minute first set, Thiem rallied to force a decider for the first time in a match at this year's edition of the Finals, while ending Matteo Berrettini's slim qualification hopes in the process.
Despite going a break down, Djokovic - who will now battle it out with Federer for a last-four spot - seemed to have turned the tide in the final set, but Thiem thrived under the pressure, fighting back to clinch a remarkable win on a tie-break.
Djokovic looked set to take control after breaking on Thiem's second service game, yet the Austrian returned the favour to draw level at 3-3.
Thiem denied Djokovic a chance to claim the set in game 10, forcing the world number two onto the backfoot with a venomous serve.
Djokovic was at his best to nose himself ahead in the tie-break with a stunning cross-court shot, but Thiem found a way back, only for an overhit forehand to give last year's runner up an advantage he did not relinquish.
Two sensational backhands saw Thiem respond with a decisive early break in set two, racing into a lead that proved unassailable.
Thiem raised his arms to the crowd as he restored parity on his serve, though it was Djokovic's turn to fire up the spectators in the opening game of the decider, thumping the air after a wonderful defensive shot won him his first point.
It was to no avail as Thiem claimed another break, but Djokovic - after failing to take advantage of three chances to bounce straight back - did manage to swing momentum in his favour in game six.
However, Thiem refused to go down, holding serve magnificently before breaking for a fourth time, though a loss of focus at the vital moment resulted in another tie-break.
A sloppy start put Thiem on the back foot, but three successive winners paved the way for the world number five to force Djokovic into a weak shot into the net and ensure his place in the semi-finals for the first time.