Williams, a three-time winner, looked on her way out when Lisa Raymond served for the match at a set-up and 5-3.
But the number six seed held her nerve and forced a break from which Raymond never recovered, as Williams cruised through the decider to clinch a 6-7 (4-7) 7-5 6-2 victory. She will now meet Jelena Jankovic.
“It‘s all about surviving to another day,” she said.
“I almost met my match today but it‘s nice to know that she played so well and I was still able to get through it.”
By contrast, Mauresmo was rarely troubled as she despatched doubles expert Samantha Stosur in straight sets on Centre Court.
The world number one, a three-time Wimbledon semi-finalist, simply had too much quality as she won 6-4 6-2.
“I felt I served and returned pretty well and took the opportunity I had right at the beginning of the match, and then took another couple of chances in the second set, so yeah I am very satisfied about this match,” said Mauresmo, winner of a first Grand Slam singles title in Melbourne last January.
Mauresmo will face another Australian in round three after Nicole Pratt came from behind to beat the number 29 seed Tatiana Golovin.
Meanwhile, Maria Sharapova made light work of American Ashley Harkleroad, 6-2 6-2, out on Court Two — the so-called “graveyard of champions”.
The Russian teenager, winner in 2004, will now play Amy Frazier, also of the US who beat Hungarian Melinda Czink in straight sets.
Number 15 seed Daniela Hantuchova was given a stern examination by Jamea Jackson of the US before coming through 6-4 4-6 7-5.
Hantuchova now faces Katarina Srebotnik of Slovenia, who beat Australian Alicia Molik in straight sets.
Former French Open champion Anastasia Myskina moved seamlessly into the third round as she took apart German Martina Muller 6-2 6-1 in just 51 minutes.
There was a shock on Court 14 where eighth seed Patty Schnyder of Switzerland crashed out to France’s Severine Bremond.
Elena Dementieva, the 25-year-old number seven seed, was given a scare by American Meghann Shaughnessy before coming through 5-7 6-3 7-5. The Russian meets compatriot Elena Likhovtseva for a place in round four after beating Tian-Tian Sun of China in straight sets.
Serbia and Montenegro’s Ana Ivanovic, the 19th seed, put out the last remaining British girl Sarah Borwell 6-1 6-2.