SAN DIEGO — Aaron Judge wanted to be a “Yankee for life.”
Now, it looks like he will be.
The Yankees and their best player agreed to a nine-year, $360 million contract on Wednesday, The Post’s Jon Heyman confirmed, keeping the AL MVP in The Bronx for the foreseeable future and likely the rest of his career. MLB Network first reported the agreement, which is pending a physical.
While the Yankees had been considered the favorites to keep their homegrown star — at least until this week at the winter meetings — Judge managed to pack plenty of drama into his free agency.
His hometown San Francisco Giants made a huge push to get the Linden, Calif., native back to the Bay Area and then there was a late push by the big-spending Padres and a quick trip to San Diego by Judge on Tuesday.
None of it was enough.
In the end, managing general partner Hal Steinbrenner decided to up the Yankees’ offer by another year and $40 million, matching the one on the table from the Giants, which convinced Judge to return.
“Our owner spearheaded the efforts, as he stated he would do everything he could in his power to retain Aaron Judge,’’ general manager Brian Cashman said Wednesday before the end of the winter meetings at the Grand Hyatt. “Rest assured, he’s putting his money where his mouth is in those efforts.”
The payoff allowed Judge to win his bet on himself in a bigger way than many thought possible, going from the seven-year, $213.5 million extension he turned down on Opening Day into the richest contract in Yankees history.
It’s also the biggest per-year deal ever for a position player, at $40 million annually, blowing by the Angels’ Mike Trout’s $35.5 million annual salary.
It’s believed the Padres at least floated a 10-year, $400 million deal, meaning Judge likely left some money on the table.
He also got a full no-trade clause and is expected to become the next Yankees captain, the first since Derek Jeter.
Whether he would have actually spurned the team that drafted him and with whom he became perhaps the game’s brightest star, only Judge knows for sure.
The talks were unlike any Cashman has had.
“I certainly never had to negotiate and try to retain somebody that just broke Roger Maris’ American League home run record,’’ Cashman said.
The GM said he followed the news of Judge’s trip to San Diego and dalliances with other teams through the media.
“They’ve done a good job holding their cards to the vest in regards to who they were seeing [and] what their intentions are,’’ Cashman said of Judge and his agent, Page Odle. “We had no expectations about when or how the decisions would be made.”
Cashman said he and Steinbrenner — as well as manager Aaron Boone — were in contact with Judge, who flew to San Diego on Tuesday to meet with the Padres for the first time.
“Our organization tried to stay connected in every way possible and Hal Steinbrenner spoke directly with Aaron Judge … to make sure there was gonna be no stone unturned,’ Cashman said.
Throughout Tuesday and into Wednesday, there was concern from the Yankees, who were left to wait for Judge’s decision.
Steinbrenner, though, clearly was willing to be extremely aggressive after saying publicly how much of a priority it was for the Yankees to bring Judge back to The Bronx.
He ended up green-lighting the extra year and expenditure to match San Francisco for Judge.
The end result was similar to the Yankees’ pursuit of Gerrit Cole, which also got done at a higher price than expected the last time the winter meetings were in San Diego.
This time, it was Steinbrenner delivering over the phone from Italy.
“Hal was intimately involved and needed to be,’’ Cashman said. “I remember talking to Hal at some point during the season and said, ‘You are going to have to be driving this.’ ”
That’s what Steinbrenner ended up doing, much to Boone’s relief.
“[Tuesday] was a long, rough day in a lot of ways,’’ Boone said. “I was concerned all day and had a pit in my stomach all day. I was definitely concerned about it.”
Boone said he placed one final call to Judge before going to bed Tuesday night.
“I wanted to make sure he knew, certainly, how I felt about him and how we felt about him, too,” Boone said.
He awoke to the news that he’d have his star back in the lineup.
“It’s an enormous boost,’’ Boone said.