Five-time champion and third seed Federer next faces Feliciano Lopez of Spain
US Open: Federer in five as Rublev strikes in generation game
Roger Federer recorded his 80th US Open win and 17th in 17 meetings with grizzled Russian Mikhail Youzhny on Thursday to reach the last 32, where he was joined by Andrey Rublev, the latest teenage upstart in New York.
Federer, 36, needed a second successive five-setter to reach the third round with a 6-1, 6-7 (3/7), 4-6, 6-4, 6-2 win over fellow veteran Youzhny, just one year his junior.
Five-time champion and third seed Federer had also needed five sets to see off US teenager Frances Tiafoe in the first round.
The 36-year-old next faces another 35-year-old, Feliciano Lopez of Spain, for a place in the last 16. His record against Lopez is just as solid - 12-0.
"It was quite a lot of fun out there - I feel quite warmed up by now," said Australian Open and Wimbledon champion Federer, who fired 63 winners and 68 unforced errors.
Youzhny admitted he had cramped, which meant he could move left to right but not forward and back.
"That was hard to watch," said Federer. "But this was probably the best match we have played against each other."
Rublev became the second teenager to make the third round when he stunned Bulgarian seventh seed Grigor Dimitrov 7-5, 7-6 (7/3), 6-3.
Rublev, just 19 and the world number 53, joins 18-year-old Denis Shapovalov of Canada in the last 32 at a Grand Slam event for the first time.
"It's an amazing feeling. I'm very happy to win this match," said Rublev after stunning Cincinnati Masters champion Dimitrov.
However, 19-year-old Taylor Fritz of the United States was unable to join Rublev and Shapovalov in the next round when he lost 6-4, 6-4, 4-6, 7-5 to Austrian sixth seed Dominic Thiem.
Thiem saved 16 of 18 break points he faced in a stalwart defensive display.
Also going through to the last 32 was 2009 champion Juan Martín Del Potro, the 24th seeded Argentine, who saw off Spanish qualifier Adrian Menendez-Maceiras 6-2, 6-3, 7-6 (7/3).
Top seed Rafael Nadal, the 2010 and 2013 champion, faces Japan's Taro Daniel, the New York-born world number 121 in the night session.
Belgian ninth seed David Goffin saw off Guido Pella of Argentina 3-6, 7-6 (7/5), 6-7 (2/7), 7-6 (7/4), 6-3 in a marathon 4hr 12min match.
He will face French 18th seed Gael Monfils, a semi-finalist last year, who downed Donald Young of the United States 6-3, 6-7 (3/7), 6-4, 2-6, 7-5.
Meanwhile, a record was set when American Shelby Rogers and 25th-seeded Australian Daria Gavrilova played out the longest ever women's singles match.
Their 3hr 33min clash saw Rogers win 7-6 (8/6), 4-6, 7-6 (7/5) on a fifth match point in a final set that lasted 90 minutes.
Their second-round tie on Court 10 went past the previous longest of the 3 hours and 23 minutes it took Johanna Konta to beat Garbine Muguruza in the second round two years ago.
Karolina Pliskova had to battle back from a set down to make the last 32 and hang on to her world number one spot.
The Czech player, who was runner-up in 2016, downed American qualifier Nicole Gibbs 2-6, 6-3, 6-4.
She was joined in the third round by fourth seed Elina Svitolina, one of the pretenders to her top ranking, and French Open champion Jelena Ostapenko.
"It's easier for the other girls to play me as there is more pressure being number one," said Pliskova who would have lost top spot had she lost.
Ukraine's Svitolina reached the last 32 for a third successive year by breezing past Russia's Evgeniya Rodina 6-4, 6-4.