Andy Murray remains on course for a third successive Shanghai Masters title after overcoming a stern examination from Radek Stepanek to reach the semi-finals.
The British No.1 was forced to dig deep after losing the opening set to prevail 4-6 6-2 6-3 and book a semi-final showdown with Roger Federer, who overcame Marin Cilic 6-3 6-4 later on Friday.
Veteran Stepanek, who had lost four of his previous five matches with the Scot, mixed up his play well early on, coming to the net whenever possible and snatching the first break of the match in the fifth game.
The world No.41 won eight out of eight points when at the net and served out what was a pretty flawless opening set 6-4 with the minimum of fuss.
After hitting only three winners in the first set, Murray went on the attack in the second, opening up his first break points after 70 minutes of action in the sixth game and snatching his chance when Stepanek double faulted for the first time.
Murray coughed up two double faults of his own to give the Czech two immediate chances to break back, but the Scot defended stoically and a second break in succession handed him the set 6-2.
Taking the momentum into the deciding set, Murray let three break points from Stepanek's opening service game slide by, and, clearly frustrated, he then relinquished his own serve to fall behind.
But the Scot is made of sterner stuff nowadays and produced his best returning game to hit back instantly before a welcome hold to love put him back in the ascendency at 3-2.
A classy backhand winner and inch-perfect lob set up three further break points for the Scot in the eighth game of the deciding set and a double fault opened the door for Murray to charge through.
Murray was satisfied with the way he finished the quarter-final but acknowledged that Stepanek had caused him problems.
"It was quite a scrappy first couple of sets, but obviously in the second set I managed to get a break and got a bit of momentum," Murray said.
"I started going for my shots and dictated a majority of those at the end of the match.
"Obviously I needed to do that because he was playing with a lot of variety, making it hard. I was a little bit tentative on some shots. I allowed him to come forward."