MADRID (AP) - Second-ranked Roger Federer lost to Kei Nishikori 6-4, 1-6, 6-2 in the third round of the Madrid Open on Thursday.

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.

Copyright 2013 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.