Federer grabbed a second service break late in the third set to effectively seal the victory and improve to 17-0 lifetime against the 35-year-old Spaniard.
He is 1-0 against Haase after a straight-sets win in Davis Cup play in 2012.
"I think it pays off playing aggressive here in Montreal", Federer said.
Ferrer came out all guns blazing and after racing into a 4-1 lead took the first set 6-4 against world No 3 Federer, who had not dropped a set since his shock defeat to Tommy Haas at the Mercedes Cup in June.
Other quarter-finals later Friday have Denis Shapovalov of Richmond Hill, Ont., against Adrian Mannarino of France and fourth-seeded Alexander Zverev of Germany against South African Kevin Anderson.
For Federer, it was plain sailing against Bautista Agut, who is winless in seven matches against the Swiss maestro. "Plus I feel comfortable at the net so why not spend some time up there instead of slugging it out from the baseline?"More news: $393M Winning Mega Millions Ticket Sold in IL
The 36-year-old Swiss will next face unseeded Dutchman Robin Haase, a 4-6, 6-3, 6-3 victor over Diego Schwartzman of Argentina.
Either Nadal or the third-ranked Federer will take over the top spot in the rankings from Scotland's Andy Murray on August 21, following the conclusion of next week's hard-court event in Cincinnati. "But it's all connected to great play".
Earlier on Friday, unseeded Haase recovered from going a set down to beat Argentine Diego Schwartzman 4-6 6-3 6-3.
"I'm looking forward to a tough match because he can serve very well and he mixes up his tactics a lot", Federer said.
The Wimbledon champion, seeded second in Canada, secured a6-4 6-4 victory in under 70 minutes to book a showdown with first-time Masters 1000 semi-finalist Robin Haase.