When Roger Federer began the 2017 season, he couldn’t have envisioned where he would be entering the U.S. Open, the season’s final Grand Slam

He couldn’t have envisioned winning the Australian Open, winning Wimbledon, winning top tier events back-to-back at Indian Wells and Miami, and a total of five tournaments in all.

He was just trying to see if his all-time-great game could still be competitive at age 35, and whether his body, now at age 36 with a million tennis miles on it, would hold up.

So here he is in Flushing Meadows, the owner of a record 19 Grand Slam titles and the No. 3 world ranking, with a chance to become No. 1 again when the Open’s two-week run begins on Monday.

He wasn’t at the Open last year, deciding after Wimbledon to take the remainder of the season off to rest and rehab a surgically repaired knee. He came back with a vengeance, and after the Indian Wells and Miami titles in the spring he skipped the claycourt season, including the French Open. These decisions have proved key to his success, and also are a distinct counterpoint to this year’s Open field that has been decimated by injury.

Stan Wawrinka, the defending champion, is out after knee surgery. Novak Djokovic, last year’s beaten finalist, is out with an elbow problem. Kei Nishikori and Milos Raonic are out with injuries. Former No. 1 Andy Murray pulled out Saturday with a hip injury.

advertisement | advertise on newsday

Federer couldn’t have foreseen any of this, either.

“I mean, well, I didn’t foresee that the defending champ and the finalist wouldn’t be here,” he said. “And that Andy was going to struggle this year. You could foresee that maybe, you know, Rafa and me would be back in some stage in some shape or form, but maybe not quite like this. So I think we’re all a bit surprised.”

Rafael Nadal struggled through an injury plagued season last year, but with some significant rest (which included skipping Wimbledon). He’s had a superior 2017 at age 31, winning his 10th French Open and ascending to No. 1. Nadal and Federer have a chance to meet at the Open for the very first time.

“Rafa’s year has been exceptional, winning the 10th French Open,” said Federer. “I mean, people didn’t think he was going to win the French Open again. For me, only once he retires I believe he won’t win anymore. He’s that good of a player. I’m not too surprised he’s back to this magnitude, and being back at world No. 1 after all these years is really exceptional, really nice for him.”

There is an element of surprise for Nadal in how this season has turned out, that he and Federer are at the Open and the clear favorites.

@NewsdaySports

“In January, yes,” said Nadal yesterday of his diminished expectations at the start of the season, and those of Federer. “Now, a little bit less. In terms of favorites or not favorites always is the same . . . is something that probably you and we don’t expect to have that much success, but here we are. And we worked well, we worked with passion, and we played well. So let’s see how we finish season.”

As for a potential meeting with Federer in the Open for the first time (it would be in the semifinals), Nadal smiled a lot as he professed not to be looking forward to such an historical meeting.

“Sounds very good, but the real thing, I prefer to play against another player, an easier one if it’s possible,” he said, grinning.

The last time Federer played, he lost to Alexander Zverev in the final at Montreal at the beginning of the month. Zverev is the next big thing in men’s tennis (he’s also won five times this year), but Federer was struggling with a back problem which seems to have sorted itself out.

He has drawn aspiring American player Frances Tiafoe in the first round.

advertisement | advertise on newsday

“Clearly he has nothing to lose but everything to gain,” said Federer. “It’s a tough one. He’s an aggressive baseliner like so many of the Americans. Thankfully I played him in Miami this year so I have a little bit of an idea of how he plays, and his patterns and what he prefers to do.”

It’s the sort of thing you would expect the game’s best-ever player to say, taking nothing for granted. As he looks out over the depleted field, he sees opportunity for himself and everyone else.

“When somebody is injured, somebody else wins,” said Federer. “We saw that last year, you know, when Rafa and me weren’t around, somebody else stepped up. Always seems somebody takes advantage of the fact, and that some players are not around. Then you have got to be in the right place at the right time and be healthy and fresh and all that.”

And that’s what Federer seems to be, healthy and fresh and all that. It’s difficult to believe that he won the last of his five consecutive Open titles in 2008, but here he is again with a real chance. And rest was a key component.

“It was a great offseason, didn’t have any setbacks, and I was really inspired and motivated to come back strong one more time to the tour,” said Federer. “It’s been a great year, and I hope we can keep playing like this.”