Roger Federer won the Madrid Open for the third time Sunday, rallying past Tomas Berdych 3-6, 7-5, 7-5 on the new blue clay court and overtaking Rafael Nadal for the No. 2 ranking.

Federer prevailed in a tournament in which top-ranked Novak Djokovic and Nadal had already been eliminated, both blaming the court their early exits.

"It is amazing to win here again," said Federer, whose other titles came in 2006 and 2009. "It has been a tough tournament. Tough to move, but you've got to try to make the most of it. Here there was some good tennis and some bad tennis, but you see that in all tournaments."

Federer defeated an opponent who had beaten him in three of their previous five matches. Berdych hit 14 winners and made just two unforced errors in a dominant first set.

The Swiss star, however, found his ground game, breaking twice to even the score and force the decisive third set. He finally won after Berdych saved three championship points.

The sixth-seeded Berdych jumped to a 3-0 lead after hitting a crosscourt return to take Federer's first service game. Federer saved two set points before Berdych clinched the first set with a big serve.

Federer struggled with his shots, but the 16-time Grand Slam winner evened the match by breaking twice in the second set, once when Berdych double-faulted on set point.

"Tomas played very well," Federer said. "I'm sure we will see each other many more times and they will be quality matches like this one."

Berdych was in control most of the way but became erratic as the pressure grew in the deciding set. Serving to send the match to a tiebreaker, he fell behind 0-40. He rallied to force deuce, only to hit long and then net his final volley to end the match in just more than 2 1/2 hours.

"He showed that he is really the star," Berdych said.

SI Apps
We've Got Apps Too
Get expert analysis, unrivaled access, and the award-winning storytelling only SI can provide - from Peter King, Tom Verducci, Lee Jenkins, Seth Davis, and more - delivered straight to you, along with up-to-the-minute news and live scores.