David Ferrer's victory over Janko Tipsarevic means Andy Murray will play Roger Federer in the last four of the ATP World Tour Finals.
The final match of the round robin at the O2 Arena was a dead rubber as both Ferrer and Tipsarevic had already been eliminated, but their contest did decide whether Federer or Juan Martin Del Potro would top the group.
And with Spaniard Ferrer fighting back from a dreadful start to win 4-6 6-3 6-1, it set up the mouthwatering last four clash between Murray and Federer.
Murray has a winning record against the Swiss star, leading 10-8, and has won their last two matches but Federer won both their previous meetings here, in the group stages in 2009 and 2010.
The other semi-final will see Novak Djokovik play Juan Martin Del Potro, who scored a surprise win over Federer in Saturday's early match.
Tipsarevic, who said he had been playing "horrible tennis" earlier in the week after coming into the tournament feeling unwell, raced out of the blocks and powered into a 4-0 lead.
Ferrer cut a frustrated figure at that point with Sky commentator Annabel Croft tweeting "Never seen David Ferrer in such a bad mood on court" after he threw his racket to the floor in frustration.
Despite a brief comeback, Ferrer had too much to do and Tipsarevic registered his first set of the week with a forehand pass to win the opener 6-4.
But, perhaps still feeling the effects of his illness, Tipsarevic faded from that first-set high and Ferrer cashed in.
The Spaniard levelled by taking the second set 6-3 and then raced through the decider to win it 6-1.