Second-ranked Roger Federer lost to Kei Nishikori 6-4, 1-6, 6-2 in the third round.
After recovering from Nishikori's strong start, it looked as if Federer found his stride after roaring back in the second set. But Nishikori reasserted his ground game in the decider after breaking the defending champion for a 3-1 advantage and held on for the surprising victory to reach the quarterfinals.
Federer's early exit leaves Rafael Nadal as the favorite after world No. 1 Novak Djokovic lost on Tuesday. Nadal beat Mikhail Youzhny 6-2, 6-3 earlier.
Serena Williams and Maria Sharapova also reached the quarters in straight sets.
Having already established control by winning Youzhny's second service game, Nadal kept a point going with a deft no-look backhand flick before nailing a winner down the line to hold his serve and delight his fans at the Caja Magica.
The fifth-ranked Spaniard broke Youzhny again by dinking the ball over the net while on the run, giving it so much backspin it twisted away from the Russian.
Fittingly, Nadal polished off the third-round match by chasing down a ball and returning it cross-court.
Nadal, who is aiming for his seventh straight final since returning from injury, improved to 28-2 this year.
He will play either David Ferrer or Tommy Haas in the quarterfinal.
Also, Tomas Berdych defeated Kevin Anderson of South Africa 7-6 (5), 7-5, to make the final eight, while Pablo Andujar also advanced after fellow Spaniard Daniel Gimeno-Traver retired.
Second-seeded Roger Federer and third-seeded Andy Murray also have third-round matches later Thursday.
Williams dispatched Maria Kirilenko of Russia 6-3, 6-1, after Sharapova put away Sabine Lisicki of Germany 6-2, 7-5.
Williams dominated Kirilenko, who dropped the first set with one of several unforced errors. The defending champion also used a strong serve and return game, working the 12th-ranked Russian back and forth on the baseline of the red clay court with her precise forehand drives.
"I just felt really relaxed, like I was taking my time," Williams said. "I had been missing my serve when I was hitting it harder, so I took some pace off and didn't hit as hard as I usually do.
"It was easy because when you take off pace you don't hit as hard and don't exhaust as much energy. And hitting a serve or a winner are both fun."
Williams will face Anabel Medina Garrigues of Spain, who reached the quarterfinals after Yaroslava Shvedova withdrew with a right arm injury.
The 15-time Grand Slam winner called Medina Garrigues a "grinder" and predicted a "tough match" in front of the Spanish crowd.
Williams beat Sharapova in the quarterfinals last year en route to the title. This year they are on opposite sides of the bracket, meaning they could only meet in the final.
Sharapova used her big serve to take the first set with relative ease, but Lisicki put up resistance in the second.
Both players traded early breaks in the second set before Sharapova converted a fourth break point when Lisicki returned her well-placed slice into the net.
Sharapova didn't waste the opportunity to serve out the match, hitting an ace and forcing Lisicki into three errors in the final game to finish the match.
"She is the kind of opponent that plays extremely well against the top players," said Sharapova, who lost to Lisicki last year at Wimbledon.
Sharapova will face either Daniela Hantuchova or Kaia Kanepi next.
The Madrid Open is a key warm-up tournament for the French Open, where Sharapova will try to defend her title.
"(Last year) was an incredible memory for me and one that I will have the rest of my life," she said. "I'm still very hungry to win it. When I have that type of attitude I work harder to that goal. I find a lot of motivation at going back and trying to defend my title."