Azarenka had won all seven of the pair's previous meetings but their last one was the first three-setter and this one followed suit, as Stosur raced through the second set and even broke in the first game of the third, going up 30-15 in her ensuing serving game. But the No.3-seeded Azarenka hung tough, winning six of the next eight games to sneak past the No.9-seeded Stosur under the lights, 64 16 63.
"I think it was a very interesting match," Azarenka said. "It was very competitive in the first set - I was down a break, and I'm happy I could pull myself together and get the break back, and then be dominant after that. In the second set I felt Sam really took control - she played really well and took it to a whole new level. And I was getting a little bit passive and not taking my opportunities when I got them.
"It was important for me to get back in there in the third set and take control with my game again. I was focused and concentrated and I'm happy I could turn it around and finish with a win today."
Azarenka is playing her second event back after a two month ankle injury lay-off, and is beginning to show the kind of form that saw her win the Australian Open and Doha earlier in the year.
"It's all a process - I'm just trying to improve day to day, and I feel it's happening," Azarenka said. "I will probably never be truly satisfied, but I'm on a good road. Winning matches is very important, because it gives you opportunities to play more matches. That's really what I'm looking for right now.
"Getting an opportunity to play an opponent as great as Sam today was just great."
"I was already a bit off in Madrid but played through it, and it came back last night," Sharapova said. "It's not smart to compete two or three more matches here with the French Open starting soon.
"Every tournament means a lot to me, but with Paris coming up I need to make smart decisions."
"For sure I'm happy to be in the semis, but I feel sorry for Maria and I hope she recovers soon," Errani sympathized. "It's a very special tournament for me here and I will keep trying to do my best."
Errani is not only the first Italian to reach the semifinals of this event in 27 years - since Laura Garrone achieved the feat way back in 1986 - but on Monday she will also become the second Italian to crack the Top 5, when she goes from No.6 to No.5. Francesca Schiavone is a former World No.4.
"I'm very happy about that and I hope to continue, maybe even go better," Errani commented.
Errani Vs Sharapova Video: Errani Interview
Azarenka leads Errani in their head-to-head series, 5-1. They split a pair of three-setters in their first two meetings in 2008, but Azarenka has won routinely in all four of their meetings since then.
"I think she's a terrific player, especially on clay," Azarenka said of the Italian. "She really proved herself last year, playing so consistently throughout the year, and playing here is definitely an advantage for her. But I've played against big crowds before so it's nothing new. I'm excited about it."