The incredible moment left Kyrgios and tennis commentators in shock. "I actually didn't think I was going to get it".
"I just try to go my way, I'm not looking around who was winning or who was losing", said the German, who was at a loss to account for a bad day at the office.
Federer returned Kyrgios' thunderous serve who then pulled off a nice little shot himself, with the Swiss legend sprinting towards the ball.
"These shots can only really happen on a big court where you play with the single posts in the doubles alley".
"If you do that, I think you can get bogged down and you're in a bit of trouble".
"The way he behaves on court, you his demeanor, I could definitely take away".
Early on, tensions ran high for Kyrgios, who was overheard berating his camp, which appeared to be encouraging him to get in his first serve.
"He's an unbelievable frontrunner", Kyrgios said.
"I was trying everything until the last point".
Afterward, Kyrgios said he was frustrated about not capitalizing on his chances. "Played a bad service game". F***ing "first serve, first serve, first serve'". Just it was tough.
"I need to hire a coach", Kyrgios bellowed as he was broken to trail 4-0 in the second.
With Kyrgios serving at 5-5, Federer asked the question again, and Kyrgios could only reply with two unforced errors to hand his opponent the break. He said not having a coach had nothing to do with his performance Saturday.
A ninth tie-break in 10 sets between the pair seemed likely at the start of Saturday's contest when Kyrgios failed to take four break points in the seventh game, as Federer struggled to land first serves. "Doesn't take a rocket scientist to figure that out".
Federer, who is now headed for a quarterfinal matchup with Novak Djokovic, overcame an early push from Nick Kyrgios - not to mention some of Kyrgios' signature on-court silliness - to deliver one of the tourney's top shots and move into the final 16.
"I'm very happy to have won", said the second seed. He saved all five break points he faced and is now 13-1 for his career against Gasquet, including 11 wins in a row.
Meanwhile, defending men's champion Rafael Nadal reached his fourth grand slam quarterfinal of the season, and 36th of his career, by getting past Nikoloz Basilashvili 6-3 6-3 6-7 (6) 6-4, while No 11 John Isner of the USA made it that far at Flushing Meadows for the first time since 2011. On the men's side, I can not even think about returning John Isner (6ft 10in/2.08m) or Kevin Anderson (6ft 8ins/2.03m) or somebody like this.
Williams reached the quarterfinals at Flushing Meadows for a 10th consecutive appearance - she wasn't there a year ago because she gave birth to her daughter during the tournament - by picking her level up after a lull and using 18 aces to beat Kaia Kanepi of Estonia 6-0 4-6 6-3.