Serena Williams claimed her place in the last 16 of the French Open but was pushed all the way by Maria Jose Martinez Sanchez.
The 10-time grand slam winner fought back from a set down against the Spaniard to clinch a 4-6 6-3 6-4 victory in a gruelling two hour clash on Suzanne Lenglen court.
Martinez Sanchez, ranked 43rd in the world, had never reached the third round at the French Open before having failed to clear the first hurdle in her two previous appearances at Roland Garros.
But the Spaniard looked confident against the second seed and opened up the advantage with a break of serve in game five.
Williams battled hard to get back on level terms, but was unable to capitalise on the chances which came her way while at the same time making too many unforced errors, allowing Martinez Sanchez to take the opening set after 40 minutes.
American Williams, whose sister Venus crashed out in her third-round match yesterday, continued to struggle at the start of the second set with too many mistakes littering her game.
However, she found her range in game six to go a break up and it proved decisive, with Martinez Sanchez unable to claw the break back.
The third set was a nervy affair and both players struggled with their serve throughout.
Williams drew first blood in game three, Martina Sanchez claimed it back in the very next game but the American snatched another break in the fifth to once more edge ahead.
That proved crucial and, after further breaks for both players, Williams eventually found herself serving for the match, wrapping up the victory on the first of two match points.
She will now face Canadian Aleksandra Wozniak, the 24th seed, in the last 16.