Canadian Milos Raonic fell in three tough sets to rival Fernando Verdasco at the Madrid Open on Tuesday.

The Spaniard beat the Thornhill, Ont., native by scores of 6-4, 2-6, 7-6 (7) to reach the third round.

Raonic led in the deciding tiebreak 4-1 but Verdasco came back. Raonic saved two match points but sent a forehand long on a third, sealing a second-round exit.

Raonic, seeded 12th, let his mistakes get the better of his game in the key moments of a match that lasted for more than two and a half hours at the Caja Magica.

Raonic struck a dozen aces and lost serve only once while saving six break points.

"I'm fairly disappointed with today, I didn't do what I needed to do," Raonic said. "I had too many mistakes, too much up and down. Consistency was an issue for me today.

"I had hopes when I led 4-1 in the tiebreaker and when I saved those two match points. But in the end I was missing shots by quite a bit or he was playing well. I was letting him get ahead in points. It all depended on me today."

Raonic put together a comeback after losing the first set and had it all to play for in the deciding set.

He came from 0-30 down to secure a 5-4 lead, but Vedasco answered, tying the set without allowing a point in front of his home crowd.

Clay-court tuneup

He was playing his third spring event on clay after winning a round in Monte Carlo and advancing the Barcelona semifinals, where he lost to Rafael Nadal in heavy, wet conditions. He's trying to get his clay-court game ready for the French Open, which starts May 26. Raonic reached the third round of the Grand Slam event in 2012.

After winning two matches on hardcourts against Verdasco in 2011, Raonic has dropped the subsequent three that they've contested, all on clay.

Raonic had to save three break points in the 11th game, finally smashing down an overhead to take a tight 6-5 lead. A game later, it went into a tiebreaker.

"I should have done better than I did here. I'm capable of much better and hopefully I can show that," said Raonic, now 18-7 this season.

Defending champion Roger Federer looked comfortable on clay in his first match in two months Tuesday, easing past Radek Stepanek 6-3, 6-3 to reach the third round.

Elsewhere, Grigor Dimitrov stunned Novak Djokovic, beating the top-ranked Serb 7-6 (6), 6-7 (8), 6-3 for the biggest win of his career.

The 28th-ranked Bulgarian saved three set points in the first before taking the lead, and Djokovic then appeared to hurt his right ankle when trailing 4-2 in the second. The Serbian player slipped on the baseline and winced in pain, then immediately called for a trainer and took a lengthy break to get treatment.

The wait for the game to resume annoyed the crowd, who turned against Djokovic and began chanting Dimitrov's name.

Djokovic, who ended Rafael Nadal's eight-year winning streak at the Monte Carlo Masters last month, said the loss had more to do with poor preparations than an injury.

"I didn't prepare myself so good," Djokovic said. "For 12 days after Monte Carlo I haven't touched the racquet."

Serena Williams moves on

In the women's event, defending champion Serena Williams moved her title defence into the third round after beating Lourdes Dominguez Lino of Spain 6-2, 7-5.

The top-ranked Williams struggled a bit to counter her opponent's drop-shots and lobs, but stayed on course for a fourth title of the year and 50th of her career.

The second-ranked Federer took a break after losing in the Indian Wells quarterfinals on hardcourt to Rafael Nadal. But he broke early to take control of the first set. He then broke Stepanek three times in the second, losing his own serve once.

"I'm very happy, because he has caused me difficulties in the past," Federer said about the 34-year-old Stepanek — who these days is one of the few players on tour older than the Swiss star.

Federer can equal John McEnroe's career tally of 77 titles if he defends the Madrid trophy, having won last year on the criticized blue clay that organizers decided to discontinue.

Like many of his fellow players, Federer said the traditional red surface was better.

Third-seeded Andy Murray had a tougher time against Florian Mayer before outlasting the German 7-6 (11), 7-6 (3).

Murray said he struggled with the altitude and found it hard to breathe at the end of the first set where "there were so many long points."

Madrid is 2,180 feet above sea level. The Scotsman said Mayer's array of shots and different pace made it difficult.

No. 13 Tommy Haas of Germany and No. 15 Stanislas Wawrinka of Switzerland were among other seeded players to advance. No. 8 Richard Gasquet of France lost 7-5, 3-6, 6-4 to Daniel Gimeno-Traver of Spain.

Also, Marion Bartoli of France overcame a fall to beat qualifier Maria-Teresa Torro-Flor of Spain 6-4, 2-6, 6-4.

With files from The Canadian Press