(CNN) -- World No. 1 Novak Djokovic was dumped out of the Madrid Open in the second round after an inspired performance by 21-year-old Grigor Dimitrov.
The Bulgarian hadn't previously won a set against the six-time grand slam winner but took the match in three sets to secure the biggest scalp of his career to date.
Djokovic, from Serbia, received treatment on his ankle during the second set but recovered to save a match point and send the match into a decider.
But Dimitrov held his nerve to break Djokovic's serve twice in the final set and take the match 7-6 6-7 6-3.
Roger Federer showed little signs of rustiness as he dispatched Radek Stepanek to move into the third round.
The 17-time grand slam winner and defending champion cruised past his Czech opponent, wrapping up a 6-3 6-3 victory in 81 minutes.
The Swiss was last in action in mid-March when he was knocked out of the BNP Paribas Open at Indian Wells by Spain's Rafael Nadal.
But despite his near two-month absence from competition, the 31-year-old was back in the groove swiftly to set up a meeating with either Japan's Kei Nishikori or Viktor Troicki of Serbia.
"I didn't think I played incredible, but that's not what I was expecting myself to do here. But I didn't play bad, either," Federer told the official ATP Tour website.
"So I'm very happy with how things went today. Stepanek is a player who can cause a lot of difficulties in the game. He has caused me difficulties in the past. Today that wasn't the case. I thought I was pretty much in control."
Federer, world No. 2, defeated Tomas Berdych in the 2012 Madrid final and is looking for a 22nd ATP World Tour Masters 1000 title, which would see him draw level with Nadal's tally.
Unlike Federer, the world No. 3, Britain's Andy Murray, was made to work hard for his place in round three after overcoming Germany's Florian Mayer 7-6 7-6.
Murray saved five set points in the opener and came from a break down in the second set to register his 400th Tour victory in just over two hours. He will face French No. 16 seed Gilles Simon next.
The 25-year-old told a press conference: "I felt like I hit the ball very well today. I just didn't return so well. That was the only thing I would have liked to have done better."
"He served well and hit a lot of aces on those points, but also I wasn't reading the serve. So even when I was getting to it I was a little bit late and missed a few too many returns.
"Apart from that, I moved very well, which I didn't do in Monte Carlo, so that's a big improvement."
Two top 10 seeds were knocked out on an eventful Tuesday.
Czech Janko Tipsarevic, seeded nine, was beaten 7-6 6-3 by Argentinean Juan Monaco while Richard Gasquet, the French No. 8 seed was defeated 7-5 3-6 6-4 by Daniel Gimeno-Traver, from Spain.
There were also wins for Stanislas Wawrinka, the Swiss No. 16 seed, and Tommy Haas, the No. 13 seed from Germany.
In the women's draw, Serena Williams beat Spain's Lourdes Dominguez Lino 6-2 7-5. The world No. 1 was then asked about comments about her from American starlet Sloane Stephens.
In an interview with ESPN magazine Stephens, who stunned Williams by beating her in the Australian Open quarterfinals, claimed Serena hadn't spoken to her since that match in January.
But Williams refused to criticize the 20-year-old and told reporters: "I'm a big Sloane Stephens fan and always have been. I've always said that I think she can be the best in the world. I'll always continue to think that and always be rooting for her.
"I really just always wish her and anyone, really, especially from America the best. We don't have that many American players, so it's always exciting to see so many young players doing so well."
Elsewhere, Mario Bartoli, the French No. 15 seed, recovered from an injury to her ankle as she beat Spaniard Maria-Teresa Torro-Flor 6-4 2-6 6-4.
Germany's Sabine Lisicki and Russia's Svetlana Kuznetsova were also winners, beating Dominika Cibulkova and Nadia Petrova respectively.