Andy Murray put in a game performance against world number two Rafael Nadal but fell to a 7-6 6-4 defeat in the third round of the Madrid Masters.
Nadal made it two wins out of two against Murray
Murray had the better of the opening exchanges but missed five early break-point chances and eventually lost the first set 7-5 on a tie-break.
The British number one then broke in the first game of the second set and had further chances to extend his lead.
But Nadal levelled at 4-4 and broke again to seal a thrilling victory.
"I had chances and I didn't take them," said Murray.
"It could have gone either way. I'm disappointed to lose but it was a good match, I learned from it.
"I'm happy that I'm back playing at this level and giving the world number two a great match."
Nadal had said before the match that Murray would be in the world's top six if he had not missed most of the summer with a wrist injury.
Murray produced a performance worthy of that billing, but ultimately Nadal showed the bit extra that takes you to number two in the world.
He staved off five break-points when Murray was dominating early on in the first set and turned up the heat to break as the set reached its climax.
Murray broke back impressively to force a tie-break, but once again Nadal found an edge when it mattered.
The first set was very important, the second set very tough - it was very competitive
The first three games of the second set all went against the serve leaving Murray with the advantage.
He held two points for a double break at 4-2 but missed both with backhands that drifted wide.
And from that point on Nadal took over, breaking twice to seal a hard-fought victory.
"The first set was very important, the second set very tough - it was very competitive," said Nadal.
"It was draining physically. I'm happy to have survived and very happy to be in the quarter-finals."
The Spaniard now meets David Nalbandian who beat fellow Argentine Juan Martin del Potro 6-2 6-4 earlier in the day.
Defending champion Roger Federer gained revenge for two defeats earlier in the season as he crushed Argentine Guillermo Canas 6-0 6-3.
Novak Djokovic, Fernando Gonzalez, Mario Ancic and Nicolas Kiefer also booked their places in the quarters.