SAN DIEGO — Meeting with Gerrit Cole and the pitcher’s wife for the first time last week at the Fashion Island Hotel in Newport Beach, California, Brian Cashman tossed out a literary reference that prompted laughter.

“You’re my white whale,” the New York Yankees general manager said he told Cole. “He was someone we drafted in the first round, and he chose to go to college. And we tried to trade for him, and Pittsburgh chose to trade him to Houston instead. So we’re hoping three’s a charm.”

It was. With the help of what sources told ESPN is a record $324 million, nine-year contract.

Cashman harpooned the biggest prize in the free-agent market, agreeing to a deal with the 29-year-old right-hander Tuesday night.

After two dominant seasons with Houston, Cole will join a rotation that projects to include Luis Severino, Masahiro Tanaka, James Paxton and J.A. Happ or Domingo German, and a roster built around young stars Aaron Judge, Gleyber Torres and Gary Sanchez.

“You’re talking about a guy that is the best of the best,” Yankees manager Aaron Boone said Wednesday. “You’re just hopefully finishing off a team that can potentially win a championship.”

After several seasons of payroll restraint — at least by pinstriped standards — the Yankees increased their projected luxury tax payroll to $247 million. That is $39 million above the initial threshold and about $1 million below the start of the highest surtax and a penalty that would back up the Yankees’ top 2021 amateur draft pick by 10 slots. New York is on track to owe at least $14 million in tax for 2020, and even more if outfielder Brett Gardner is re-signed and additions are made to the bullpen.

Other than taking on high-priced outfielder Giancarlo Stanton, the Yankees in recent years had promoted prospects and acquired cost-effective options that included Luke Voit and Gio Urshela.

“I think we’re just using every tool in the toolbox, not just the big hammer, but it doesn’t mean the big hammer is not still available,” Cashman said.

In adding Cole, the Yankees will forfeit their second-highest pick next June (about No. 64), their fifth-highest (about No. 175) and $1 million of 2020-21 international signing bonus allocation. Houston will receive an extra pick, somewhere around No. 75.

Voit seemed set to cede his uniform to Cole.

“Hey the number 45 jersey fits really weird and runs really big,” Voit tweeted. “Not a problem that you will want worry about for 9 years, so I’ll take care of it.”

Cole grew up a Yankees fan. Newark’s The Star-Ledger ran a photo that caught the then-11-year-old in the stands before Game 6 of the 2001 World Series in Phoenix holding a pinstriped sign that read: “Yankee Fan Today Tomorrow Forever.”

“You’re seeing a guy that’s really talented, really good at his craft, really intelligent,” Boone said. “This is what greatness can look like when it all gets synced up.”

Yankees owner Hal Steinbrenner had several conversations with Cole’s agent, Scott Boras, and authorized the guarantee of a ninth year. Cole was drafted by the Yankees with the 28th overall pick in 2008, but he spurned then and enrolled at UCLA.

“We definitely weren’t mad at the Cole family or Gerrit Cole himself. More mad at ourselves,” Cashman said. “I don’t think many high school kids being drafted in the first round by their childhood dream team with financial components coming their way that far exceed what a college scholarship would be worth would say, ‘I’m going to college because it’ll all work out and I’m going to bet on myself.'”

The Associated Press contributed to this report.