The No. 3-seeded Muguruza had lost all three previous meetings against Sharapova, who won two of her five Grand Slam titles at Roland Garros.
Muguruza has not dropped a set so far in this year's tournament as she seeks a second championship in Paris and third major trophy overall. The Spaniard won the French Open in 2016 and Wimbledon last year.
She needed only 70 minutes to eliminate Sharapova and dominated her with superb returning, breaking the former No. 1 a half-dozen times.
Sharapova was hardly at her best right from the start, double-faulting to get broken in the opening game. She ended up with six double-faults and 27 total unforced errors, 12 more than Muguruza.
Muguruza raced to a 4-0 lead and never looked back.
Sharapova didn't need to play a point in the fourth round, because Serena Williams pulled out of their much-anticipated match with an injured chest muscle. Muguruza essentially got that round off, too: Her opponent, Lesia Tsurenko, quit with an injury after only two games.
Muguruza will face Simona Halep or Angelique Kerber in the semifinals.