In the end, what seemed an obvious outcome finally materialized, as Cody Bellinger and the Yankees came to an agreement Wednesday, pending a physical, The Post confirmed.

The deal is for $162.5 million over five years and includes opt-outs after the second and third years, as well as a $20 million signing bonus, according to The Post’s Jon Heyman.

The move comes in what’s been a quiet offseason in The Bronx, as the Yankees made it clear that retaining the 30-year-old was their top priority after he declined a $25 million player option.

By the time the sides came to a deal, the lefty-swinging Bellinger was the only premier position player still available on the free agent market.

The lengthy negotiation — which was reminiscent of the DJ LeMahieu staredown with the Yankees when he was a free agent in 2021 — means the Yankee lineup will likely look very similar to a year ago, when Bellinger helped replace Juan Soto after his departure for Queens.

Bellinger was believed to have been looking for a seven-year deal, but it was unclear what market there was for him, especially after the Mets traded for Luis Robert Jr. of the White Sox late Tuesday night.

The Post previously reported that the Mets were among a group of teams — including the Phillies and Dodgers — that showed interest in Bellinger, who has battled injuries and inconsistency in his career, but flourished with the Yankees following a trade from the Cubs last offseason after Soto left for the Mets.

New York Yankees’ Cody Bellinger tosses his bat after hitting a RBI double during the third inning of a MLB baseball game against the Toronto Blue Jays at Yankee Stadium. Sunday, Sept. 7, 2025 in New York.Cody Bellinger tosses his bat after hitting a RBI double during the third inning of the Yankees’ 4-3 win over the Blue Jays at the Stadium on Sept. 7, 2025. Noah K. Murray-NY Post

But not only had the Mets acquired Robert, that deal came after the Dodgers outbid the Mets for Kyle Tucker, who got four years and $240 million to go to Los Angeles.

Bellinger was considered the second-best position player available this offseason and he’ll again be part of an outfield consisting of Aaron Judge and Trent Grisham, who is back with the Yankees after accepting the $22 million qualifying offer.

That could leave Jasson Domínguez and Spencer Jones without roles in The Bronx in 2026, since neither seems an ideal fit to be a fourth outfielder.

Retaining Bellinger means the lineup will look very much the same as it did in the latter part of 2025, with Ben Rice getting a chance to prove himself as a regular first baseman while José Caballero fills in for Anthony Volpe at shortstop in the wake of Volpe’s offseason labrum surgery.

The Yankees are still expected to add to their starting rotation, especially with Gerrit Cole, Carlos Rodón and Clarke Schmidt all beginning the year recovering from surgeries.

Go beyond the box score with the Bombers

Sign up for Inside the Yankees by Greg Joyce, exclusively on Sports+.

Thank you

And Bellinger provides a stabilizing force not just in the lineup — where he bounced back from a rough final season with the Cubs to arguably his best since he was the NL MVP with the Dodgers in 2019 — but on defense, as well.

He remained mostly healthy last year and lived up to expectations by hitting well at Yankee Stadium, where he put up an OPS of .909, compared to .715 on the road.

And he’ll also be able to fill in occasionally in center field and right, as well as first base, something he did last season.

A bruised heel limited Bellinger’s effectiveness in the postseason, but neither side swayed on their desire for a reunion.

“I had an unbelievable time putting on this uniform,” Bellinger said after the Yankees lost to Toronto in the ALDS. “Yankee Stadium, the fans, the organization, the culture that these guys have created in this locker room. It really is special.”