Roger Federer's Madrid Open campaign is over after Kei Nishikori secured a 6-4 1-6 6-2 victory over the former world number one.
The Swiss pro was well-matched by his opponent in the first few games of the opening set and struggled to find the break of serve on the clay court.
Despite some impressive footwork, Federer lost the advantage when Nishikori snatched a vital break of serve to push on and grab a one-set lead.
His dominance didn't last long though, as Federer fought back in the second set with powerful shots across the court and swift returns to get an early break and tie level.
While the momentum seemed to be with Federer, the number two seed, who has had two months away from action, was unable to carry his dominance through to the third set. Nishikori capitalised to wrap up the match and book a place in the quarter-finals.