Sharapova has won 11 consecutive matches on Stuttgart's indoor clay. Her semifinal opponent will be eight-seeded Sara Errani, who was leading 6-3, 6-7 (6), 3-0 when Carla Suarez Navarro retired with a hand injury.
"This was a big victory for me, the biggest since my injury," said Sharapova, who returned late last year after missing more than four months following shoulder surgery.
Radwanska played her best tennis in the penultimate game, when she fought off six match points and finally broke Sharapova's serve. Under pressure by Radwanska, Sharapova made two straight backhand errors as she dropped her serve.
But Radwanska could not keep the momentum and Sharapova's forehand winner down the line gave her two more match points. Sharapova wasted the first with a wild forehand that was both long and wide, but then nailed a forehand winner to the corner to end the match.
Sharapova is aiming for her first title of the year and the 30th of her career. Ranked No. 9, she would have fallen out of the top 10 with a loss Friday.
"I've been on the tour for so long I wasn't really thinking about it," she said.
Suarez Navarro received treatment after winning the second set and quit three games later.
"I feel really sorry, I have huge respect for her," Errani said. "It is not easy to play her. I tried to move her around and to be aggressive."