Top-seeded Angelique Kerber also reached the quarterfinals, downing Alexandra Cadantu of Romania 6-1, 6-0 in just 50 minutes. Kerber was broken while serving for the first set but was otherwise hardly challenged by the 72nd-ranked Cadantu, who scored just eight points in total on her own serve.
"I felt really well on court,'' the 10th-ranked German said. "I was very relaxed and played well from the start.''
The 12th-ranked American Stephens won just two of the first 14 points and fell behind 5-2, but she saved three set points before taking the opener in a tiebreaker.
"I let out some screams, which I normally don't do,'' Stephens said about her slow start. "I am just happy to get through.''
Stephens went up 3-1 in the second set before Petkovic reeled off 10 straight points and got back into the match.
Stephens managed an early break in the third set, and the Australian Open semifinalist closed out the victory on her third match point.
Earlier, Dominika Cibulkova of Slovakia routed Katarzyna Piter of Poland 6-0, 6-1 in less than 53 minutes. Piter, playing in her first main draw of the year, broke the seventh-seeded Cibulkova in the second set for her only game.
In her fourth quarterfinal of the season, one-time finalist Cibulkova will take on two-time former champion Ana Ivanovic.
Kerber is one win short of securing the eighth and final spot at the season-ending WTA Championships in Istanbul.