Roger Federer advanced to the semifinals of the Rogers Cup in Toronto with a 6-3, 4-6, 6-3 victory over Spain's David Ferrer and will next take on another Spaniard, Feliciano Lopez.

Federer extended his perfect record against Ferrer to 15-0 with Friday night's victory at this U.S. Open tune-up event.

The Swiss world No. 3 hit seven aces and won 80 percent of his first-serve points, as his greater firepower won out over the Spaniard's tenacious defense.

His return game, meanwhile, produced five service breaks over the course of the one-hour, 53-minute quarterfinal match.

Federer turned 33 on Friday and the Toronto crowd showed their affection for the tennis great by singing him "Happy Birthday" at the start of the second set.

The Swiss put just 52 percent of his first serves in play in the first set but he improved his accuracy as the match wore on to give himself a clear edge over his seventh-ranked opponent.

"I was able to find energy and really serve better at the very end, which was key against David because he was doing a really good job on my second serve to put me under pressure," Federer said afterward.

He will square off Saturday night against Lopez, who upset home-crowd favorite Milos Raonic of Canada 6-4, 6-7 (5-7), 6-3 Friday evening.

Saturday's first semifinal will pit Frenchman Jo-Wilfried Tsonga against Bulgaria's Grigor Dimitrov.

The Rogers Cup is the sixth of nine ATP World Tour Masters 1000 events and one of the biggest hard-court tournaments on the men's tennis calendar.

The U.S. Open, the most prestigious hard-court event in tennis, gets underway on Aug. 25. EFE