NEW YORK -- A point away from losing the second set with his opponent serving, Frances Tiafoe looked at a positive.
At least, he figured, he would be able to change out of his sweaty shirt and sneakers.
A couple of minutes later, he hadn't changed his clothes. He had changed around the match.
Tiafoe rallied to steal the second set and went on to earn his way back to the US Open quarterfinals for the third straight year, beating Alexei Popyrin 6-4, 7-6 (3), 2-6, 6-3 on Sunday night.
"The second set was a huge, huge win for me," Tiafoe said. "You know, 5-3, 40-love, him serving, how good he serves, that was really, really big. To break there and then to win that set was huge."
The No. 20 seed will attempt to match the best Grand Slam result of his career when he faces No. 9 seed Grigor Dimitrov on Tuesday for a berth in the semifinals.
Tiafoe lost to eventual champion Carlos Alcaraz in that round in 2022 and was eliminated last year in the quarterfinals by Ben Shelton.
Tiafoe is the first American man to reach three consecutive US Open quarterfinals since Andy Roddick from 2006 to 2008. Pete Sampras and Andre Agassi are the only other American men since 2000 to reach the final eight in New York three straight times.
All that after what had been a poor first half of the season before Tiafoe heated up on the hard-court swing leading into the US Open.
"Everything is happening when it's meant to happen," Tiafoe said. "I'm glad it's happening now because this is the most important time for me."
Tiafoe needed no extra motivation before Sunday's match but said a surprise visit and an unexpected pep talk from 23-time major winner Serena Williams inspired him like never before.
"Telling me she's always following no matter what, telling me it's so good to see now that I'm done, you're the guy of color playing and doing well," he said.
"I'm, like, damn. That's really, really cool that she sees me as that."
Williams returned to the tournament Saturday for the first time since playing her final match at Arthur Ashe two years ago and was spotted again Sunday, taking in the action.
"It was really cool to have her want to talk to me before a match and really say she wants me to do this thing and that I'm capable of doing it," Tiafoe said. "I don't think it will hit me like that if anybody else said it to me."
Williams, however, might be torn on who to cheer for when Tiafoe and Dimitrov meet in the next round, as she counts the Bulgarian as a longtime friend. Dimitrov said she also gave him a pep talk Saturday, and she was in the stands when he beat Andrey Rublev on Sunday.
As for Tiafoe, he turned his match late in the second set, when Popyrin was serving with a 5-3 lead and a chance to even it at a set apiece. Tiafoe won the next five points to break and quickly took control of the tiebreaker by jumping to a 4-1 lead.
Popyrin, the No. 28 seed from Australia, upset defending champion Novak Djokovic on Friday to reach the fourth round of a Grand Slam for the first time. But he believed he might have gone further had he put away the second set.
"Definitely a lost opportunity," Popyrin said. "I've been saying all week that I think against these top players you have to take your chances when you have them. Obviously 5-3, 40-love up serving, it's a really big choke from my end."
No. 12 seed Taylor Fritz won earlier Sunday, and another American, Tommy Paul, will play No. 1-ranked Jannik Sinner of Italy in the fourth round Monday. Should Paul win that, he would join Tiafoe and Fritz to give the U.S. three men in the quarterfinals at Flushing Meadows for the second consecutive year.
The last time there were that many players from the host country in the US Open men's quarterfinals twice in a row was in 2001 and 2002.
The Associated Press and Reuters contributed to this report.