Not long after that, Federer found himself in the precarious position of twice being one point from defeat.
Steady as ever, even at 33, Federer held on. Coming all the way back from a two-set deficit, and saving two match points along the way, Federer edged 20th-seeded Gael Monfils of France 4-6, 3-6, 6-4, 7-5, 6-2 on Thursday night to reach the US Open semifinals for the first time since 2011.
Frustrated by Monfils' unpredictable style, flummoxed by the swirling wind, and missing shots he normally makes, Federer faced the two match points while trailing 5-4 in the fourth set.
"When I was down two match points, that's when I wasn't feeling so great anymore," Federer said, laughing. "I thought, 'This is it. This is the last point, man. Go down fighting. Don't miss an easy shot and let him have it.' "
He got out of that hole, starting a five-game run that put the match in his control for the first time. It helped that Monfils' quality of play dipped, including what wound up being a total of 10 double-faults.
This was the ninth time Federer has won a match after dropping the opening two sets.
"I served well and stayed in the match and somehow turned it around," Federer said. "I was really starting to play better and better as the match went on. It was a great feeling."
Monfils was trying to reach his second career Grand Slam semifinal. Instead, Federer advanced to his 36th, ninth at Flushing Meadows. Five of Federer's record 17 major singles titles have come at the US Open, but he exited in the quarterfinals in 2012, and the fourth round in '13.
On Saturday, the second-seeded Federer will play 14th-seeded Marin Cilic of Croatia. The other semifinal will be No. 1 Novak Djokovic against No. 10 Kei Nishikori; their quarterfinal victories came Wednesday.
Cilic wasn't allowed to play in last year's US Open, forced to the sideline by a four-month doping suspension that he says he didn't deserve. But Cilic reached the second Grand Slam semifinal of his career, and first since 2010, by beating sixth-seeded Tomas Berdych of the Czech Republic 6-2, 6-4, 7-6 (4) earlier Thursday.
"I mean, it was a difficult period. I didn't know when I'm going to start back. But (it) was also (a) good period for me," Cilic said. "I matured a bit more and I was working, day after day."
His quarterfinal ended hours before the other began, and Cilic probably assumed he would wind up facing Federer next.
But that did not seem a certainty through the first 78 minutes of Federer-Monfils. That's how long it took Monfils to shake off a twisted ankle and build a two-set lead, assisted by Federer's 26 unforced errors in that span.
Even that far behind, Federer said, "I still thought the finish line was far for Gael. I knew I could play better tennis."
The air was swirling in the cavernous arena, rippling the players' shirts and the giant American flag atop the stadium. In the early going, Monfils' whiplike forehand was able to cut through the wind.
Monfils is nothing if not one of a kind. In an era where some men, including Federer, have two coaches, Monfils goes without any. He'll admit to tanking points, games or entire sets. He sips sodas during matches, including Thursday. He'll go for a between-the-legs shot when a mundane forehand would do.
As the clock was about to strike 11 p.m., Monfils held his match points as Federer served. On the first, Monfils had an opening for a backhand passing shot, but it flew long.
On the second, Federer produced a forehand winner, and the crowd roared.
After Federer held there for 5-all, Monfils had a letdown, double-faulting twice in a row to get broken. Soon enough they were in the fifth set -- which began with another break by Federer.
By then, he was on his way.
"You start feeling better, because you feel probably he's a bit low right now after such a tough fourth set," Federer said.
Make no mistake, though. This was not easy. The turnaround might not have been possible for Federer a year ago, when he was dealing with a bad back and trying to figure out whether he should switch to a larger racket head.
But now Federer, however old, is approaching his skills of old. He got to the finals at his previous four tournaments -- including a loss to Djokovic in Wimbledon's title match in July -- the first such run by a 30-something since Ivan Lendl in 1990. One more victory, and Federer's final streak will stretch to five in a row.
Federer's Epic Comeback
Roger Federer beat Gael Monfils 4-6, 3-6, 6-4, 7-5, 6-2 to advance to the US Open semifinals.
Federer On Quarterfinal: 'Unbelievable'
Roger Federer discusses his two-set comeback against Gael Monfils in an epic five-setter to reach the US Open semifinals.
Cilic Tops Berdych
Marin Cilic beat Tomas Berdych in straight sets to advance to his first career semifinal at the US Open.
Cilic On First Quarterfinal Win At US Open
Marin Cilic discusses his win over Tomas Berdych and how he has developed his game over the past year.
Five Things We Learned: US Open Day 11
Greg Garber and Howard Bryant break down five things they learned from the eleventh day at the US Open.