Rafael Nadal fell to a shock defeat by 18-year-old Canadian Denis Shapovalov at the Rogers Cup in Montreal.
Wildcard Shapovalov came from a set down to beat top seed Nadal 3-6 6-4 7-6 (6-4) and become the youngest player to reach a Masters 1000 quarter-final.
Nadal's loss means Andy Murray remains world number one, but only until next week's Cincinnati Masters, where Nadal or Roger Federer will replace him.
Federer also progressed to the last eight, with victory over David Ferrer.
The Swiss world number three, 36, came from a set behind to beat the Spaniard 4-6 6-4 6-2 and next faces Roberto Bautista Agut, also of Spain, who defeated Frenchman Gael Monfils 4-6 7-6 (7-5) 7-6 (6-2).
World number 143 Shapovalov, the 2016 Wimbledon junior champion, plays 29-year-old Frenchman Adrian Mannarino.
In the other quarter-finals, Germany's Alexander Zverev, who beat Australian Nick Kyrgios 6-4 6-3, will play South African Kevin Anderson,who saw off American Sam Querrey 6-4 6-1 in the last 16.
And Argentina's Diego Schwartzman will face Robin Haase of the Netherlands. Haase beat Bulgaria's Grigor Dimitrov 7-6 (6-3) 4-6 6-1, while Schwartzman defeated American Jared Donaldson 0-6 7-5 7-5.
Roger Federer became the first man to win Wimbledon eight times and extended his record to 19 Grand Slam titles with victory over Croatia's Marin Cilic.
The Swiss third seed won 6-3 6-1 6-4 as seventh seed Cilic struggled with a blister on his left foot and broke down in tears during the second set.
Federer, 35, finished the contest in one hour and 41 minutes to claim his first Wimbledon title since 2012.
He becomes the oldest man in the Open era to win at the All England Club.
"It is cruel sometimes," Federer said of Cilic's physical difficulties.
"But Marin fought well and is a hero, so congratulations on a wonderful tournament."
Federer surpasses Pete Sampras and William Renshaw, who won their seventh titles in 2000 and 1889 respectively, with only Martina Navratilova still ahead in terms of Wimbledon singles titles on nine.
He has won two of the three Grand Slam titles so far this year, having returned from a six-month break to win the Australian Open in January.
With 19 major titles he extends his lead over Rafael Nadal in the men's game to four, and now stands joint-fourth on the all-time list with Helen Wills Moody, five behind Margaret Court on 24.
Among his long list of achievements, Federer became the first man since Bjorn Borg in 1976 to win the Wimbledon title without dropping a set.
The tournament favourite from the outset, he was rarely troubled over the course of seven matches, and Cilic was not in the condition to provide a serious test.
"I never give up in a match. I gave it my best - it's all I can do," Cilic said afterwards.
Federer was playing in his 11th Wimbledon final and Cilic his first, and the gap in experience showed from the early stages.
Cilic, 28, hit a forehand which bounced before the net on the opening point as the nerves appeared hard to shake off.
Federer offered up a couple of early double faults but there was a sense of inevitability about the first break, which came in game five after Cilic fell heavily chasing down a drop shot, and then sent a backhand into the net.
A beautiful cross-court forehand helped Federer towards set point in game nine and Cilic duly double-faulted, ending the set with a 49% first-serve percentage that hardly troubled the Swiss.
After Federer made it 3-0 in the second set, a tearful Cilic sat in his chair as the doctor, tournament referee and supervisor attended to him.
Roger Federer and Novak Djokovic made swift progress with straight-set wins in the second round at Wimbledon.
Third seed Federer, seeking a record eighth title, beat Dusan Lajovic 7-6 (7-0) 6-3 6-2 on a hot evening on Centre Court.
Djokovic, seeded second, earlier swept past Adam Pavlasek 6-2 6-2 6-1 on Court One.
Sixth seed Milos Raonic, eighth seed Dominic Thiem and 10th seed Alexander Zverev secured places in round three.
Swiss Federer and Djokovic of Serbia both completed matches for the first time this week after their first-round opponents had retired with injuries.
Three-time champion Djokovic needed just over 90 minutes to see off Czech Pavlasek, the world number 136 making his debut at the Championships.
The 30-year-old will play Latvia's Ernests Gulbis, after the world number 589 beat Argentine Juan Martin del Potro 6-4 6-4 7-6 (7-3).
"Overall I managed to impose my own rhythm and play the game I intended to play," Djokovic, who converted seven of his 18 break points, told the BBC.
"It was very warm and hot and not easy to play point after point in some of the long rallies."
Federer, 35, lost the opening seven points and fell 2-0 down against Lajovic, who played well above his ranking of 79 for much of the contest.
It was still not enough to seriously trouble the Swiss, watched by his parents in the royal box.
Federer broke back immediately and after a tight set, dominated the tie-break to take decisive control of proceedings.
Ninety minutes, nine aces and 30 winners later, he wrapped up a solid win and a third-round clash with Germany's 27th seed Mischa Zverev.
"I struggled early on. I couldn't get rid of the nerves and struggled to find my rhythm," Federer told BBC Sport.
"I should feel comfortable here, and I do, but the problem is on grass if you're struggling it can take a while.
"I wasn't too worried. Nerves are a funny thing, sometimes you get horribly nervous and other times it's a piece of cake. I'm happy it happened in the second round."
Serena Williams beat Maria Sharapova for the 18th time in a row to reach the Australian Open semi-finals.