Updated

Defending champion Roger Federer was stunned by Japan's Kei Nishikori, while former titlist Rafael Nadal was an easy third-round winner Thursday at the $4.425 million Madrid Open, an ATP Masters event.

The 14th-seeded Nishikori knocked out the second-seeded former world No. 1 Federer, 6-4, 1-6, 6-2, in 1 hour, 35 minutes at The Magic Box.

"He was my idol and to beat him was one of the goals for my tennis career," Nishikori said. "Beating Roger is, yeah ... I need a couple of days to celebrate."

The 23-year-old Nishikori notched two of his three service breaks in the deciding third set. Federer settled for only a pair of breaks on Day 5 and popped seven aces in a losing effort.

"He was the better player today for sure," Federer said. "I was lacking control from the baseline and that carried through from start to finish. Overall I'm disappointed with my play."

The 31-year-old Federer is a three-time Madrid champion and two-time runner-up who beat Czech Tomas Berdych in last year's finale. The Swiss icon had reached at least the quarterfinals in his previous nine trips here.

Federer, who has yet to title anywhere in 2013, wasn't the first high-profile casualty of the week, as the Madrid Open lost its top seed on Tuesday when promising Bulgarian Grigor Dimitrov stunned world No. 1 Novak Djokovic.

Meanwhile, the fifth-seeded former No. 1 Nadal cruised past Russian veteran Mikhail Youzhny 6-2, 6-3 in 75 minutes on his beloved red clay.

The hot Spanish hero Nadal is now a dazzling 28-2 this season and seeking a fifth title in his seventh tournament. He titled in Barcelona two weeks ago, reaching a sixth final in six tries.

The reigning French Open king is a two-time Madrid titlist and two-time runner-up in the Spanish capital.

Nadal will battle fourth-seeded fellow Spaniard David Ferrer in Friday's quarterfinals, as Ferrer cooled off hot Tommy Haas 7-5, 4-6, 6-4. The 14th- seeded Haas was fresh off his clay-court title in Munich in his native Germany last week. Ferrer was a clay-court runner-up in Portugal last week.

Third-seeded Andy Murray also advanced with a 2-6, 6-4, 7-6 (8-6) win over 16th-seeded Frenchman Gilles Simon in a rematch of the 2008 Madrid final, which was won by the British star.

Last year's Madrid runner-up Berdych moved on with a 7-6 (7-5), 7-5 victory over big-serving South African Kevin Anderson, while seventh-seeded French star Jo-Wilfried Tsonga reached the round of eight with a come-from-behind 4-6, 6-3, 6-2 victory over Spanish southpaw Fernando Verdasco.

Also on Thursday, 15th-seeded Swiss Stanislas Wawrinka stayed hot by overcoming the aforementioned Dimitrov 3-6, 6-4, 6-1 and wild card Pablo Andujar was tied with fellow Spaniard Daniel Gimeno-Traver 5-5 in the first set when Gimeno-Traver retired from their bout. Andujar will encounter Nishikori in the quarters.

Wawrinka, fresh off his clay-court title in Portugal where he toppled Ferrer in the final last week, will take on Tsonga on Friday.