Caroline Wozniacki was made to fight for her place in the fourth round in Indian Wells as she battled back to see off the challenge from Sofia Arvidsson.
The former world number one looked set to crash out of the tournament when she trailed Arvidsson 6-3 5-4 but she took six games on the bounce to seal the second set and go a break up in the third.
She dominated the third set as Arvidsson had not answer to the fight back - winning just two more games.
Wozniacki came through 3-6 7-5 6-2. She will now face another former world number one Ana Ivanovic.
Speaking on court after the match Wozniacki said: "I knew it would be a tough match.
"I have known Sofia since I was 12 or 13, we had the same sponsor and practiced and played together all the time, and she just came from a win in Memphis.
"But I fought for every point and made it through - I'm happy to be through this one."
Ivanovic came through against Ksenia Pervak 67(8-10) 63 62.
Maria Sharapova was another player who had to dig deep to get over the line as she almost threw a 5-0 second set lead away.
The Russian seemed to be cruising to a 6-3 6-0 victory against Simona Halep when she struggled to serve out the match.
Halep took four games in a row, breaking Sharapova twice, before the former world number one finally wrapped up a 6-3 6-4 victory.
FemaleFirst Helen Earnshaw