Andy Murray looked in danger of ending his unbeaten streak at the Shanghai Masters, but clawed his way back in the final two sets to dispatch Radek Stepanek in the quarterfinals.

Murray, the two-time defending champion, eventually prevailed over the Czech veteran 4-6, 6-2, 6-3. "To be honest, I felt okay in the first set," Murray said. "Didn't really say too much. It was quite a scrappy first couple of sets. Obviously the second set I managed to get a break, got a bit of momentum.

"For me, the beginning of the third set was what was most frustrating. I got a hold the first game, then was up Love 40 on his serve, had broken him the last two service games. I played a couple of really poor shots I would hopefully not normally make on points like that.

"He got that game. Then I got broken the following game after a couple long rallies. He had some unbelievable gets. That period of the match was tough.

"Then I just managed to turn it around in time. I played actually very well I thought the last 10, 15 minutes of the match. But it was quite scrappy, the first couple of sets."

Murray shifted gears in the final part of the third set, winning 21 of the last 26 points to snuff out any chance of an upset. "I started going for my shots and dictated a majority of those at the end of the match," he said. "Obviously I needed to because he was playing with a lot of variety, making it hard for me.

"I was a little bit tentative on some shots, allowed him to come forward. He has very flat strokes. When he's in control of the points, he's hitting it very close to the line. It's very, very tough to play against.

"When I managed to push him back behind the baseline, I started to open up the court better and, yeah, just had a little bit more intensity at the end of the match."

The U.S. Open champion will now face Roger Federer in the semi-finals after the world number one defeated Marin Cilic in his quarterfinal match. "It's a challenge playing against him because he has a lot of variety in his game," Murray added. "He can win points from a lot of different parts of the court.

"Each time you play against him, there's things that happen a lot differently compared with the previous time so you need to make sure that you're on your toes and you're ready to make some adjustments during the match, as well.

"You need to think while you're out there against him, that's for sure. It's always very, very tough playing against him. You need to make sure that you're prepared to make adjustments during the match."