STUTTGART, Germany -- Top-seeded Maria Sharapova outlasted Ana Ivanovic 7-5, 4-6, 6-4 Friday to advance to the semifinals of the Porsche Grand Prix.

Sharapova, the defending champion, needed more than 3 hours to overcome Lucie Safarova a day earlier. This one was an hour shorter but nearly as intense.

"It was hard to get my body going, I need some time to warm up a little," Sharapova said. "Another tough one."

Sharapova will play third-seeded Angelique Kerber, who defeated Yaroslava Shvedova of Kazakhstan 6-3, 7-6 (2) to reach her third semifinal of the season.

Against Ivanovic, another former No. 1 and the 2008 French Open champion, Sharapova squandered a 4-1 lead in the third set before breaking serve again and serving out the match on her second match point.

Last year, Sharapova used the indoor clay-court tournament to warm up for the French Open, where she won the title.

Kerber is aiming for her first title of the year after finishing runner-up in Monterrey. She's made the semifinals in Stuttgart for the first time.

Shvedova trailed 4-1 before breaking back. But she dropped her serve again with two errors from the baseline. The two traded breaks in the first three games of the second set before Kerber opened a 3-1 lead, but Shvedova pulled even at 3-3.

Kerber ran up a 5-1 lead in the tiebreaker.

"I played my game and I was aggressive," Kerber said.