Second-seeded Roger Federer advanced to the quarterfinals of the ATP Rogers Cup in Montreal on Thursday, but it was not easy.
Federer had to rally from a set down to beat Spanish veteran David Ferrer 4-6, 6-4, 6-2 in a match that lasted three minutes shy of two hours.
The Swiss star has now won 14 straight matches and has lost only twice all year.
Federer improved his head-to-head record against Ferrer to 17-0, but Ferrer took a set from Federer for the sixth time since they met for the first time in 2003. Thursday was their first matchup in three years.
"I already beat other players 17 times," said Federer. "Sometimes I played them maybe 30 or 40 times. They ended up beating me at a certain stages, like Roddick, Gonzalez and Soderling. Sometimes I beat them 10 times in a row. At the end, they always ended up beating me. That's why I have a lot of respect for this match today. I know it can't continue that way. Seventeen is a lot.
"The last match we played were three tight sets in Toronto, then three sets Cincinnati, and again today. So, these statistics are a bit ridiculous, because I have a lot of respect for David. As a person, he's very nice. He's a great fighter on the court. So this type of head-to-head is a bit strange."
Federer committed 19 unforced errors while losing the opening set.
Federer was more aggressive in the second set. He let a set point slip away with Ferrer serving at 3-5, but Federer served out the second set in the 10th game.
Federer broke Ferrer's serve in the opening game of the third set, then saved a break point in the second game while taking a 2-0 lead. Federer controlled matters from that point.
Federer's quarterfinal opponent will be 12th-seeded Roberto Bautista Agut of Spain, who outlasted Gael Monfils of France 4-6, 7-6 (5), 7-6 (2).
Monfils had won the previous three matches against Bautista Agut, but the Spaniard prevailed this time, saving a match point against him in the third set.
"I'm happy, as I knew I would have to play a lot of rallies," said Bautista Agut. "I'm going to try and recover and enjoy the win today before preparing for tomorrow's match."
Monfils, who saved four match points while beating Kei Nishikori on Wednesday, seemed to be in control of the match when he led 3-1 in the second set after winning the first.
Bautista Agut rallied to win the second set in a tiebreaker, and saved one match point while serving at 5-6, 30-40 in the deciding set with a big serve out wide.
Bautista Agut will have his hands full with Federer, who has a 6-0 career record against the Spaniard.
Also, Diego Schwartzman of Argentina lost the first eight games of his match against American American Jared Donaldson, but Schwartzman rallied for a 0-6, 7-5, 7-5 victory.
The 24-year-old Schwartzman will next face Dutchman Robin Haase, who upset seventh-seeded Grigor Dimitrov of Bulgaria 7-6 (3), 4-6, 6-1 in 2 hours and 9 minutes.
Dimitrov had won both of their previous meetings in straight sets, although this was their first encounter since 2014.
Haase fired 13 aces and won 77 percent of his first-serve points to stay in control.
Fourth-seeded Alexander Zverev of Germany rolled into the quarterfinals with a 6-4, 6-3 victory over 16th-seeded Nick Kyrgios of Australia, and Kevin Anderson of South Africa eliminated Sam Querrey of the United States 6-4, 6-1.
Top-seeded Rafael Nadal played a late match Thursday.