By Simon Cambers
Williams was fractionally off target with an attempted forehand winner at 5-4 in the third set and gutsy seventh seed Stosur battled back to set up a clash with fourth seed Jelena Jankovic.
The 26-year-old had outplayed four-times champion Justine Henin in the fourth round and was better than Williams, the 2002 champion, for most of a two hour-24 minute quarter-final as the sun finally returned to Court Phillipe Chatrier.
Leading by a set and 5-3, having taken an astonishing 17 consecutive points from 3-2 in the first set, Stosur failed to finish off her opponent and nearly paid the price.
"I got a little bit nervous and a little bit tight, but overall, I actually felt good," Stosur told reporters after her first win over a current world number one.
"It's not really a pressure. I guess everything is just adrenaline and all the emotions hitting you kind of at once.
"That third set I just kind of hung in there, and I was behind the whole time serving second. I had to wait for another opportunity and then I got one at 6-6 and thankfully I took it."
Williams seemed to have the match in her grasp in the deciding set and blamed herself for throwing it away.
"It was my match and I lost it. That's basically what happened," she told reporters. "She's a good player but I made so many errors and I definitely was nowhere near my best today."
Stosur tried to dominate the match with her fierce early-struck forehand and it worked a treat against a leaden-footed, lackluster Williams as she broke twice to take the opening set.
From 3-2 30-30 she embarked on a 17-point streak that seemed to have knocked the stuffing out of a mistake-riddled Williams but the American 12-times grand slam champion, who racked up 32 unforced errors in the first two sets, rarely departs without a scrap.
She broke Stosur and leveled the second set at 5-5 before storming through the tiebreak 7-2.
Stosur was forced to hang on in the decider as Williams began to blast away and she received a big let-off when the American's forehand floated long on match point.
All of a sudden the momentum changed and two brilliant points, a forehand pass and a stunning backhand, sealed a break at 6-6 and when she served for the match for a second time the Australian proved up to the task.
(Reporting by Martyn Herman; Editing by Ed Osmond and Alison Wildey)