Federer squandered six match points in the second set before beating Cilic in three. (AP Photo)

On the eve of his 33rd birthday, Roger Federer exuded vitality and endured growing pains. Marin Cilic fought off six match points in the second set and threatened to push the party to midnight.

Then Federer unleashed a series of forehand strikes to pull the plug on the Croatian's comeback bid. Blasting a forehand winner down the line to secure the lone break of the match in the ninth game of the decider, Federer served out a demanding, 7-6 (5), 6-7 (3), 6-4 triumph to reach the Rogers Cup quarterfinals for the seventh time.

On a chaotic day in which three of the top four seeds—No. 1 Novak Djokovic, No. 3 Stan Wawrinka, and No. 4 Tomas Berdych—all bit the dust, Federer moved crisply and struck cleanly for much of the match. But he struggled to create closure against a defiant opponent, who saved nine of 10 break points.

The third-ranked Swiss had imposed his advantage on the forehand side, winning nine of 10 prior sets against Cilic, who hits a wristy forehand and can flat-line that shot under pressure. When Cilic netted successive forehands to face another break point in the ninth game, it looked like familiar cracks could come back to haunt him. But the world No. 18 stood firm, zapping a 125 M.P.H. ace to fend it off and eventually hold for 5-4.

Neither man gained separation in the opening tiebreaker until Cilic blinked. Federer stepped forward to greet a second serve, startling Cilic and eliciting a netted backhand for the first mini-break and a 5-4 lead. A serve winner gave him double set point. Two points later, Federer stretched Cilic, slashing successive drives down opposite sidelines to draw the error and seize a quality 51-minute first set.

Throughout the match, Cilic was effective lashing the first serve down the middle to Federer's backhand in the deuce court. Serving to extend the match at 4-5 in the second, Cilic showed stubborn strength, fighting off six match points in a grueling 19-minute game. He played some of his best tennis on several of the match points, but got a couple of gifts from Federer. The second seed, who won 21 of 28 trips to net, was in prime position to end it on the fifth match point when he netted a routine backhand volley. Wife Mirka tried to smile off the miscue, while coach Stefan Edberg shifted slightly nervously in his seat.

Cilic saved a sixth match point when Federer sailed a forehand wide, holding with an ace for 5-5. That struggle strengthened Cilic, who opened the tiebreaker attacking to earn the mini break. Federer's forehand, which had been sharp for much of the night, failed him in the breaker, as successive forehand errors gave Cilic set point at 6-2. He banged a body serve, looking revitalized in snatching the 64-minute second set.

Cilic, who pushed Djokovic to five sets in the Wimbledon quarterfinals last month, earned the first break point of the decider, only to see Federer fend it off in a tremendous running rally. The seven-time Wimbledon champion held for 1-1.

The set stayed on serve until the ninth game. By that point, Mirka, coach Edberg, and Federer's support box were wrapped in red blankets to ward off the late evening chill. Cilic saved a ninth break point, but on the 10th, Federer hit a heavy topspin backhand return down the line to create space, then cracked a forehand for the crucial break. Crunching a diagonal forehand winner punctuated by a firm "Allez!" he earned a seventh match point 57 minutes after his last one. This time, there was no waiting game as Cilic's return missed the mark, ending an entertaining two hour, 39-minute test just a half hour shy of Federer's birthday.