World number one Novak Djokovic fell to a shock defeat by Grigor Dimitrov in the second round of the Madrid Open.
Dimitrov, the world number 28, had not won a set against Djokovic in two previous meetings but was in top form to win 7-6 (8-6) 6-7 (8-10) 6-3.
The Bulgarian, 21, saved set point at 5-4 down in the first and another in the tie-break before winning the set.
Djokovic won a second-set tie-break but Dimitrov showed incredible courage to secure the biggest win of his career.
"It's a great win for me," he said. "I know it's a big thing, of course, but you got to stay on the ground.
"Hopefully you're going to face these guys for years. It's just a match. You never know how it's going to be next time."
Serbian Djokovic, who won his third title of the year at last month's Monte Carlo Masters, received treatment on an injured ankle midway through the second.
It was the same ankle he hurt playing for Serbia in the Davis Cup last month.
Dimitrov, who beat Javier Marti in the first round, had an injury break of his own and looked physically drained after the second set.
But, with the Spanish crowd chanting his name, he drew on his reserves of energy to break Djokovic in the opening game of the third set and hold on to win the match.
"Up until Saturday I didn't know whether I would come or not because of the ankle," said Djokovic. "But I am not trying to find an excuse, he was the better player and I congratulate him."
Dimitrov won the Wimbledon and US Open junior titles in 2008 and has long been seen as a future star and potential world number one.
His progress appeared to have slowed over the last couple of years, but recent months saw him push Djokovic, Andy Murray and Rafael Nadal close.
Earlier, Britain's Andy Murray beat Germany's Florian Mayer in his opening match to record his 400th career win.