Roger Federer will move up to second in the world rankings, ahead of Rafael Nadal, after recovering from a shaky start to beat Tomas Berdych in three sets at the Madrid Open final on Sunday.
Federer struggled to settle on the controversial blue clay, but eventually edged out his Czech opponent 3-6 7-5 7-5 in a contest which lasted two hours and 38 minutes.
It was Federer's fourth title of 2012 and stands him in good stead for the French Open, which gets under way on May 27.
Berdych, seeded sixth in the Spanish capital, broke his opponent early to help open up a 4-1 lead, with that single break proving enough to seal the first set.
Federer hit back with a break at the start of the second and, although Berdych levelled things up again, the Swiss star broke again in game 12 to take the match into a final set.
The decider was on an even footing until Berdych found himself facing match points on his serve in the 12th game.
And although the Czech successfully saved three of them, his forehand into the net on the fourth handed the title to Federer.
"It feels amazing," Federer said. "Look, it's been a tough tournament and tough to move but you just go on with it and try to make the best out of it.
"There was some good tennis and there was some bad tennis as well, you see that in all the tournaments, but I thought the level of play under the circumstances was very good."