Toronto fans serenaded Roger Federer, singing "Happy Birthday" during the opening coin toss. An ornery David Ferrer muted the revelry in the second set, but couldn't prevent Federer from orchestrating a familiar refrain.

Asserting his all-court game after a lapse, Federer celebrated his 33rd birthday by subduing the Spanish party crasher, 6-3, 4-6, 6-3, to advance to the Rogers Cup semifinals for the sixth time.

These two have a history, and it's a wretched flashback for Ferrer, who took the court carrying his Prince racquets and an 0-14 career record against Federer. Perhaps stressing from past shellackings, Ferrer imploded in a hideous four-error game to gift the opening break. A benevolent Federer netted a volley to give the break right back. The fifth seed denied two break points in the third game, but Federer breezed through a love hold and ratcheted up the pressure.

A common connection among some players who've beaten Federer this season—Novak Djokovic, Kei Nishikori, Stan Wawrinka, and Ernests Gulbis—is the ability to impress the cross-court backhand to the Swiss' one-hander on pivotal points. Ferrer doesn't generate the same bite or sharp angle off his flatter two-hander, and when he slapped a backhand into net Federer had the break and a 3-2 lead.

Lunging left, Federer reflexed a stunning backhand drop volley winner to hold for 5-3. When Ferrer curled a crosscourt forehand wide, Federer collected the 35-minute opener.

It was an uneven performance from Federer in the second set. He showed flashes of shot-making brilliance—running down a Ferrer lob and whipping a slick, over-the-shoulder forehand down the line in the fifth game—but shanked some backhands, netted a few forehands, and won just three of 13 points on his second serve. He also couldn't stay in step when Ferrer raised his game.

A stray backhand opened opportunity for Ferrer in the ninth game. Sneaking in, he blocked a high forehand volley to earn double break point. Surprising Federer with a return down the line, Ferrer broke for 5-4 with a firm "Vamos!" Ferrer won 10 of the last 11 points to hijack a 38-minute second set he had spent mostly playing catch-up. Federer contributed to his own demise by tripling Ferrer's unforced error output (21 to 7) in the set.

Down 0-30 moments into the third, Federer hit a snazzy forehand swing volley and stabbed back a squash shot on the full stretch to halt a three-game slide. A snarling Ferrer continued to bark at himself between points and fire away with his trademark inside-out forehand, earning break point in the fifth game. Federer slid a serve winner down the middle to save it. A sliced ace wide and sweeping forehand drive volley completed the hold for 3-2.

Amping up the attack, Federer blocked a forehand volley for 30-all, lashed a backhand winner down the line for break point, and broke for 4-2 when Ferrer swatted a forehand into net. A commitment to moving forward at the right times—and the benefit of the bounce—aided Federer, who won 22 of 30 net trips to net. Serving-and-volleying on a game point, Federer warded off a jamming return by dipping a backhand volley that collided into the top of the tape before trickling over the net for 5-2. Federer held up his hand in apology, while Ferrer raised an eyebrow of resignation.

A forehand winner down the line brought the two-time former champion to match point. Federer snapped off a smash to wrap a one hour, 53-minute win and advance to his 51st ATP semifinal. He will face Feliciano Lopez, who upset sixth-seeded Canadian Milos Raonic in the evening's first quarterfinal. Federer is 10-0 lifetime against Lopez, including seven hard-court victories.