Yankees pitcher Gerrit Cole throws during the second inning in...

Yankees pitcher Gerrit Cole throws during the second inning in Game 5 of the World Series at Yankee Stadium on Wednesday. Credit: Newsday/Howard Schnapp

SAN ANTONIO — Gerrit Cole opted out and, almost as quick, opted back in.

In short Cole will be a member of the Yankees' rotation through at least the 2028 season, as scheduled.

The righthander, per his right in the nine-year, $324 million free-agent contract he signed before the 2020 season, opted out of the final four years and $144 million of that deal on Saturday, potentially paving the way for the 34-year-old to again hit the free-agent market.

The Yankees had until 5 p.m. (ET) Monday to void the opt out by tacking on a fifth year, worth $36 million.

But shortly before that deadline, according to a source, Cole, and his agent, Scott Boras, agreed to stay on the terms of the remaining contract — the four years and $144 million — though there were talks of the sides working out an extension of some kind down the road.

With Cole now guaranteed, assuming he's healthy, to be a Yankee through his age-38 season, the motivation for the organization doing an extension was not immediately clear.

For Cole, there was some risk in reentering the free-agent market.

Though one of the most durable, and successful, pitchers of his generation, Cole did start this season on the IL with right elbow inflammation, which kept him from a big-league mound until June 18. Had Cole, who went 8-5 with a 3.41 ERA in 17 starts this season, chosen to become a free agent, he would have been going into a market already with high-end pitching talent, a pool that includes Max Fried, Corbin Burnes, Jack Flaherty, Blake Snell, Yusei Kikuchi and Walker Buehler.

In short, as good as Cole has been, there would have been no assurance that he would have bettered what he has left on his current deal.

There is also this: Cole really had no desire to go anywhere else.

He grew up a Yankees fan and signing the kind of contract he did with the franchise was the fulfillment of a childhood dream.

Additionally, from Day One in uniform, Cole embraced the spotlight and pressure that comes with his status as ace of the Yankees.

And, for the most part, he has produced like one.

Cole, who won the 2023 AL Cy Young, is 153-80 with a 3.18 ERA in his 12 years in the big leagues, including 59-28 with a 3.12 ERA in his five seasons with the Yankees. He is 11-6 with a 2.77 ERA in 22 career postseason starts, including 5-2, 2.93 with the Yankees.

Cole in his time with the Yankees also has embraced his role as a de facto oracle of pitching for the staff, with veterans and rookies — and just about everyone in between who throw baseballs for a living — making frequent stops at or near his locker in the spring to talk about, as Cole always puts it, “the craft” of pitching.  Being dubbed the team’s “co-pitching coach” by some in the organization, including in the clubhouse, pretty much from his first season in pinstripes isn’t an accident (with no disrespect toward Matt Blake, the man with the actual title of pitching coach).

Regardless, having Cole back in the fold was an important item for Yankees to check off on their extensive offseason to-do list.

Cole fronts a rotation that is expected to include — the case most of this season — Carlos Rodon, Nestor Cortes, Clarke Schmidt and Marcus Stroman.

With the annual general managers’ meetings set to begin here Tuesday, attention switches to the free agency of Juan Soto.

The 26-year-old, the crown jewel of Boras’ stable of superstars, won’t sign during these meetings. But groundwork for what is expected to be a package in the neighborhood of $600 million — and maybe more than that — could be laid as Boras begins meeting in person with interested parties.

The Yankees, of course, will be in that mix, though with the process not truly having started, it is not yet clear how high they will be willing to go. And there is the thought, both from some inside and outside the organization, that the money it would take to re-sign Soto might be better spent spread out elsewhere as the Yankees have needs in the bullpen, the infield and, perhaps, the outfield.

Soto, not surprisingly, was the only one of the club’s free agents to receive the $21.05 million qualifying offer. That means if Soto signs elsewhere, the Yankees would receive draft pick compensation.