MASTERS CUP, Shanghai: Dates: 9-16 November Starts: 0600/1000 GMT daily Coverage: Live on Sky Sports; live text commentaries on BBC Sport website; every match live on Radio 5 Live sports extra
Murray has now beaten Federer in four of their six meetings
Andy Murray knocked Roger Federer out of the Masters Cup in Shanghai as the defending champion struggled with a lower back injury in a dramatic match.
World number two Federer had to win the final round-robin match in the Red Group to stay in the tournament, but he went down 4-6 7-6 (7-3) 7-5 to Murray.
That ensured Gilles Simon, who earlier beat Radek Stepanek, made the semis.
Murray will now face Nikolay Davydenko in the last four on Saturday, after Simon plays Novak Djokovic at 0900 GMT.
"When you play against Roger you've got to expect him to play great stuff, especially when he's behind," said Murray. "I dealt with it pretty well though and came back.
"I'm going to be a bit tired tomorrow but a win over Roger Federer means almost as much as winning the Masters Cup to me - to win against him and have a record like I do is awesome. I know I'm going to be tired but this means a lot to me."
Friday's final group match was a unique experience for Murray, who went into the match with a 3-2 record against Federer but knowing he did not need to win, having already qualified.
It made little difference to the quality of play as both men came out firing in front of a packed crowd at the Qi Jhong Stadium.
With everything to play for, Federer took the initiative and got the first break in game four when Murray went long with a forehand.
I don't quit once I step on court
The Scot responded immediately when an edgy Federer netted a backhand in the following game, but he had to save three more break points in his next couple of service games as the champion kept up the pressure.
Finally, Federer made the decisive breakthrough in a superb 10th game, firing a beautiful backhand winner and a crunching cross-court forehand before Murray dumped a drop shot in the net at set point.
It did not appear to boost the champion's confidence though and he played a poor game to drop serve at the start of the second.
He handed Murray the break with two wayward forehands and soon slipped 5-2 down after a disastrous seventh game, with two double-faults and two dreadful volleys giving Murray the double-break.
Remarkably, it was the Briton who then suffered a shocking slump in form and he became increasingly angry as Federer wiped out the advantage, Murray double-faulting to bring the score level at 5-5.
Federer appeared in trouble when he slipped a mini-break down early in the tie-break and, despite winning the point of the match with a backhand smash, it was Murray who was in control throughout.
As the final set got under way, Federer twice had lengthy treatment from the trainer on his lower back - an area he had suffered problems with in the build-up to the tournament.
Murray duly broke serve early in the decider and Federer, moving gingerly between points, looked on the verge of spoiling his record of never having quit during a match.
But the Swiss was still able to play some magnificent strokes, in particular a killer drop shot and a sweeping backhand down the line in game five as he recovered from 3-0 down to move ahead with a break at 4-3.
The drama was not over, however, as a pumped-up Murray got back on level terms yet again when Federer missed a regulation smash, to the astonishment of the 15,000 spectators.
Murray failed to convert any of seven match points in a fabulous 10th game but made no mistake two games later, sealing victory at the eighth opportunity after three hours and one minute when Federer made an error.
Afterwards, Federer - who had been chasing a fifth victory at the end-of-season event - admitted he had struggled physically,
"I don't quit once I step on court," said Federer. "My body was hurting. Normally the best of three sets is peanuts and it's a shame I couldn't handle it today."
Simon earlier completed his group matches with a 6-1 6-4 victory over Radek Stepanek to finish with a record of two wins and one defeat in the Gold Group.
The Frenchman, ranked ninth in the world, only made it into the eight-man field when Rafael Nadal pulled out with an injury on the eve of the tournament.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.