Roger Federer booked his place in the third round of the Madrid Masters tonight, but the world number one was made to work for his victory by qualifier Robby Ginepri.
Federer, the reigning champion, has been short of match practice recently having only played in the Davis Cup since his triumph at the US Open, and the Swiss ace did not have it all his own way before claiming 7-6 (7/2) 6-4 win.
Despite the closeness of the scores though, Federer was never in serious trouble and looked to be in control for the majority of the match against his American opponent.
After the first six games of the opening set had gone with serve, Ginepri had a great chance to break Federer in the seventh after establishing a 40-15 lead.
But the Swiss ace took the next four points to hold serve, and went on to take the opening set after dominating the tie-break.
The key break in the second set came in the fifth game, when a superb Federer top-spin lob proved too good for Ginepri and earned the top seed a 3-2 lead.
Ginepri had a chance to hit back in the eighth game but he was unable to take advantage of a break point and slipped 5-3 behind.
The American, who beat Austrian Jurgen Melzer in the opening round after coming through qualifying at the weekend, held his next service game but Federer then served out to love to take the match.
Federer, who received a bye in the opening round, will meet an Argentinian next, with either 13th seed Guillermo Canas or Agustin Calleri his opponent.