Federer had improved his level of play as the tournament progressed, and most expected him to overcome the Argentine.

It may have been a bit more than he bargained for, but Roger Federer fended off a stiff challenge from 19-year-old American Frances Tiafoe in his opening round match at the U.S. Open Tuesday night.

The 3rd-seed advanced to the 2nd round with a tense 5-set win under the new roof at Arthur Ashe Stadium.

Federer and Tiafoe took to the court shortly after 9 p.m. eastern time as the last match of a day that was largely rained-out. Despite the slow day, the teenager provided plenty of fireworks early on, bludgeoning a barrage of blistering groundstrokes and capitalizing on a rusty-looking Federer to seize an early lead and eventually earn the 1st set.

Tiafoe’s forehand in particular was tremendous early on as the young American consistently bothered his elder with crosscourt forehands to either gain control of rallies or win them outright.

From Federer’s side, the Swiss struggled mightily with his game and his backhand in particular. The American closed out the first set with a comfortable hold: 6-4.

“I had a bit of a slow start today, but Frances was good from the beginning,” Federer said after the match.

A momentum shift occurred early in the second set as Tiafoe’s level noticeably dropped. The American made three unforced errors and eventually missed a tricky, but makeable, volley to hand Federer a break of serve and the lead in the second set.

American teenager Frances Tiafoe stretched Roger Federer to 5 sets before eventually losing in the opening round of the US Open Tuesday night.

The Swiss didn’t look back, establishing his familiar level of rhythm and flow in his own service games before eventually breaking the American again to take the second set 6-2.

Throughout the middle portions of the match, Federer dominated proceedings with his own level rising significantly and Tiafoe’s enormous swings no longer bearing fruit. The Swiss broke Tiafoe quickly again to begin the 3rd set and raced to a 3-0 lead.

Tiafoe attempted to stabilize by fending off a break point in his ensuing service game, but Federer kept up the pressure and eventually earned the double break two games later before serving the set out to a 6-1 score line.

But a strange match of twists continued as the 70th-ranked Tiafoe rediscovered some semblance of his efforts earlier in the match and Federer’s game seemed to abandon him in the fourth set. The Swiss was broken at 1-2 after making a number of sloppy mistakes including a double fault. The American quickly seized on his opportunity, stretching his lead to 4-1 and then breaking a listless Federer again before eventually forcing a surprising 5th.

For a five-setter, the contest felt strange, with the match only 2-hours-old as the players sat down before the 5th.

Federer started strong with a hold to love as Tiafoe failed to get a single return in play but the American answered with a solid game of his own. The Swiss nudged ahead for 2-1 once again and then it was Tiafoe’s turn to trip, making a wild forehand error to give Federer a break chance and then playing a questionable drop shot that the World Number 3 easily dispatched to take the lead.

Undaunted, the American showed his spirit again, once again taking big swings and playing without fear in a spirited return game as Federer failed to close out the match at 5-3.

But the Swiss remained calm and Tiafoe’s wild errors returned to open the ensuing service game, handing Federer a Love-30 lead. Federer missed a forehand but another error from the American brought up two match points. Federer missed a slice backhand into the net on the first, but on the second Tiafoe committed his fourth error of the game to finish proceedings.

“Frances fought well, I must say. When things connect for him, he’s a very good player and he’s going to have a great future ahead,” Federer said. “I think we both enjoyed ourselves out here tonight. I’m very happy with the match. I was exciting.”

Federer will next play the winner of Blaz Kavcic and Mikhail Youzhny, who were unable to start their 1st-round match Tuesday due to the rain.