KEY BISCAYNE, Fla. (AP) Maria Sharapova has won a 3½-hour marathon to earn a semifinal berth at the Sony Ericsson Open.

Sharapova rallied to beat No. 26-seeded Alexandra Dulgheru 3-6, 7-6 (6), 7-6 (5) in a match that ended at 12:19 a.m. Sharapova's opponent Thursday will be No. 21 Andrea Petkovic, who reached the semifinals with her second upset in two days, beating No. 6 Jelena Jankovic 2-6, 6-2, 6-4.

Petkovic eliminated No. 1 Caroline Wozniacki in the fourth round.

Sharapova's match took 3 hours, 28 minutes. She won despite 17 double-faults and twice as many unforced errors as Dulgheru.

Sharapova turned her ankle late in the third set and required treatment from a trainer in the middle of a game, but the injury didn't appear to affect her.