Two-time defending champion Andy Murray earned a spot in the Shanghai Masters semifinals with a comeback win over Radek Stepanek 4-6, 6-2, 6-3 on Friday.

Murray, who improved to an 11-0 record in Shanghai, will next play either top-seeded Roger Federer or Marin Cilic.

"I just managed to turn it around in time," Murray said. "I played actually very well I thought the last 10, 15 minutes of the match."

Novak Djokovic also advanced, beating unseeded Tommy Haas of Germany 6-3, 6-3. The top-seeded Serb will next face Tomas Berdych, who beat Jo-Wilfried Tsonga 6-3, 7-6 (4).

Stepanek dominated the first set and never offered the third-seeded Murray an opportunity to break serve. The Czech posted 10 winners to only three for Murray.

Murray rebounded in the second set, breaking serve to go ahead 4-2. Stepanek had two opportunities to retrieve the service break from Murray in the seventh game, but Murray held on to his lead.

Stepanek saved two set points on his serve in the eighth game, but netted a forehand on the third set point to concede the second set.

"It was quite a scrappy first couple of sets," Murray said. "Obviously, the second set I managed to get a break, got a bit of momentum."

In the third, the 41st-ranked Stepanek was up 2-1 with a break and had a point for 3-1. But Murray broke to even the score. From 40-30 for Stepanek in that fourth game, Murray won 21 of the next 26 points to win the match.

The fourth-seeded Berdych aced Tsonga on match point.

"I think it was a really solid game and solid performance from the beginning until the end," Berdych said. "I was feeling quite well on the court.

"The biggest difference between me and Jo was I was able to take the small chances during even the first, and especially the second set."

Tsonga's only two wobbles cost him. He had a shaky eighth service game in the first set and surrendered his serve at love. The second-set tiebreaker was on course to 4-4 until Tsonga double-faulted.