“I felt it the whole time,” he said. “That’s it. I was able to play with it. My bad not to win.”

Federer has won 20 Grand Slams, the men’s record, and his total includes five U.S. Opens, but he has not won the championship at Flushing Meadows since 2008. He has not reached the semifinal stage since 2015, and last year he was ousted by John Millman in the fourth round.

This year held more promise, especially since he played well enough in July to come within a few points of winning Wimbledon. And when No. 1 Novak Djokovic was upset by Wawrinka in the fourth round of the U.S. Open, it raised hopes even higher that Federer would be able to go through and possibly meet Nadal in the final here for the first time.

Instead, Federer exited without the trophy for the 11th straight year.

“I’m happy to get a bit of break now,” he said. “Go back to practice, reassess and attack from there.”

In the previous round, Federer had dismissed No. 15 David Goffin without much trouble and appeared to be cruising into the second week of the tournament. But he looked like an entirely different player against Dimitrov, who went into the match ranked No. 78 in the world, largely because he took time off to deal with an injury.