Sharapova double-faulted six times in the first set, and was twice a break up in the second set, but couldn't shake off Bacsinszky, who earned the biggest win of her career with a win over the Russian ranked No. 4 in the world. Bacsinszky had two previous top-10 wins, the last in 2010, but both were by retirement.
"She had a really good serving day," Sharapova said of Bacsinszky. "I don't think I did much on my returns, something that's a strength of mine, and I just didn't feel like I used that to my advantage."
A day after advancing at the expense of an ill Serena Williams, Alize Cornet of France reached the quarterfinals by defeating Belgian wild card Kirsten Flipkens 7-6 (4), 1-6, 6-3. Flipkens led 3-1 in the last set.
In the quarterfinals, Kvitova will meet Caroline Garcia of France, a 6-3, 6-2 winner against Coco Vandeweghe of the U.S.
No. 7-seeded Angelique Kerber of Germany eased past Barbora Zahlavova Strycova of the Czech Republic 6-1, 6-1, and set up a quarterfinal against Elina Svitolina of Ukraine, who received a walkover when Garbine Muguruza of Spain couldn't compete because of gastroenteritis.