Sharapova, who recently lost her No. 1 world ranking to Justine Henin, rallied to defeat Williams 2-6, 6-2, 7-5. Williams was trying to win her second straight title after returning from an injury-caused layoff.
She captured the Regions Morgan Keegan Championships, but was unseeded in this two-week tournament.
Henin, meanwhile, moved into the fourth round by downing Virginie Razzano 6-2, 3-6, 7-6 (7-5).
Third-seeded Svetlana Kuznetsova was a 6-4, 6-2 winner over Jelena Kostanic Tosic while No. 4 seed Kim Clijsters won over Samantha Stosur 6-4, 6-2.
Celebrity Breakups and divorces of 2014 [PHOTOS]