Stephens, ranked 31 places below her Czech counterpart, threatened an upset when she won the first set, with a break of serve in the sixth game giving her a cushion en route to a 6-2 win.
© Getty Images
However, Safarova, who reached the French Open final last month, broke back in the fourth game of the second set to move 3-1 ahead, before ultimately drawing level by a 6-3 margin.
The world number six pulled no punches in the deciding set, inflicting one break of serve in the opening game, along with two more in the fifth and seventh to win the third set 6-1 and cruise into the last 16.
She faces another American in Coco Vandeweghe next.