The victor stunned Kyrgios, who gasped after seeing Federer return the ball, mouthing the words "oh my God".
Kyrgios, the quirky Australian with a powerful serve, likes being a bit unpredictable on the court, attempting shots most wouldn't and carrying on conversations with himself throughout a match.
Federer's tenacity reaped rewards with the second seed stealing the opening set with a backhand return pass on a rare Kyrgios serving lapse.
Despite his frustration, Kyrgios buckled down to put one game on the board in the second set and make things interesting in the third.
The fiery 23-year-old Australian bowed out of the US Open on Saturday, going down 6-4, 6-1, 7-5 to 20-time major victor Federer in the third round.
Nonetheless, Federer came up with a moment of brilliance that left fans and even Kyrgios awestruck in the third set of his 6-4, 6-1, 7-5 win.
Federer's stealth attack appeared to knock the stuffing out of Kyrgios, who coughed up two more breaks in quick succession, allowing Federer to race to a 5-0 lead before wrapping up the second set shortly after.
"I think more of my tennis is more to do with the mental side of things rather than technique or tactics or anything like that", he said. "Other big shots I remember, with Andy (Roddick), the counter-smash, and of course the between-the-legs here with Novak (Djokovic)".
'The way he behaves on court, you know, his demeanour, I could definitely take away. "He's the ultimate role model to anyone who wants to play". He's won five titles at the U.S Open, although the last arrived a decade ago.
John Isner, of the United States, celebrates after defeating Milos Raonic, of Canada, during the fourth round of the U.S. Open tennis tournament, in NY on September 2, 2018.
Kyrgios is a big talent, but tends to only turn up on occasion, and he never really seemed like a serious threat to Federer this time around.
That was the first set she had lost against Kanepi of the 10 they'd played to that point, and the first set Williams had lost at the 2018 US Open, a run that included a 6-16-2 victory over her older sister Venus in the third round Friday night.
But he said no matter what he tried, Federer had the answers.
Kyrgios showed no signs of being a sore loser.
OurnumberoneRF: Touch of Roger Federer, I mean GENIUS. No. 6 Caroline Garcia and No. 13 Kiki Bertens also lost, while 2017 runner-up Madison Keys came back to beat Aleksandra Krunic 4-6, 6-1, 6-2. All the pressure was off him.
Saturday's blockbuster was billed as the match of the first week. "When he gets in front, there's not much you can do".
- Nick Kyrgios into US Open third round after umpire intervention
- California Lawmakers Pass Net Neutrality Bill
- Tropical Storm Gordon forms near Florida
- Bills Trade AJ McCarron To Raiders
- Alisson vows not to repeat mistake after blunder
- Coca-Cola Buys Costa Coffee in a £3.9 Billion Deal
- Destiny 2: Forsaken Gets an Action-Packed and Emotional Launch Trailer
- Kaepernick Face of Nike's 30th Anniversary 'Just Do It'
- Son Heung-Min avoids military service as South Korea win Asian Games
- USA charges associate of indicted Russian with lobbying violation