The 11th-seeded Pole's game fell apart in the second set before she regrouped to seal a 7-5 0-6 6-4 victory over the ninth seed in two hours 34 minutes.
Both players struggled on serve in the opening set as Radwanska's fourth break finally helped give her the early advantage.
But her German opponent improved her game in the second as the Pole's went to pieces.
Radwanska made just 38% of first serves and won only four points on her serve as Petkovic rattled off three quick breaks.
Radwanska appeared there for the taking, but her serving improved in the decider and, even though she dropped it twice, three breaks of her own sealed victory.