A few minutes past 9 a.m. Monday, J.D. Martinez shook his new boss' hand, buttoned up a neatly pressed Boston Red Sox jersey -- No. 28 stitched onto the back -- and mugged for the cameras.

And if it had been Nov. 26 in Boston rather than Feb. 26 in Fort Myers, the whole thing would’ve been completely normal.

But nothing about this offseason was normal, not even the union of a team and a slugger that seemed all along to be a perfect match. Never mind that Martinez bashed 45 home runs last year -- including as many in August and September (24) as any Red Sox player hit all season -- or that the Sox were one of the few teams willing to confer a nine-figure contract upon a free agent. The sides still waited and waited until spring training was underway before coming together on a front-loaded five-year, $110 million agreement with three separate opt-out provisions. Then they spent another seven days reviewing medical records and hashing out contract language before finalizing the deal.

Finally! Sox hit one out of the park

Boston got its man in Martinez -- and he's way more than a consolation prize. Lauber »

So as Martinez and Red Sox president Dave Dombrowski went through their grip-and-grin routine in a media dining room that had been transformed on the fly for a news conference, one question begged to be asked, the same question that even Red Sox first baseman Hanley Ramirez seemed to ask all winter whenever he and Martinez worked out together in Miami.

Martinez didn’t get the contract he initially sought, but his deal with the Red Sox is no joke. He will make $23.75 million this year, making him the team’s highest-paid position player and second-highest overall behind lefty David Price.

And although there were medical reviews last week that forced agent Scott Boras to relocate his office to Fort Myers for what he describes as "18 hours a day of doctors, language, using our database historically to answer the needs to the team, the needs of doctors," Martinez said he never feared the deal would come apart.

The sides agreed to terms last Monday, and Martinez arrived at the Red Sox’s spring-training complex two days later to take a physical. As Wednesday and Thursday passed without the deal becoming official, team sources described challenging logistics of administering a physical in Fort Myers and relaying results up north for a review by doctors at Massachusetts General Hospital. On Thursday, Martinez even flew to Boston to be seen in person.

As the situation dragged into the weekend, it became clear Red Sox doctors had concerns about the Lisfranc ligament in Martinez’s right foot. He sprained the ligament last year and missed the first six weeks of the season, and although he’s healthy now, the team wanted protection against a long-term problem.

It was reminiscent of the last time the Red Sox signed another J.D. who was represented by Boras. In the winter of 2006-07, they held up outfielder J.D. Drew's five-year, $70 million contract for 52 days while they negotiated for protection against a future injury to his surgically repaired right shoulder.

The slugger and the Sox were destined for each other. That it took all winter to make the J.D. Martinez signing official speaks volumes about a crazy MLB offseason. AP Photo/John Minchillo

“Dave and I have known one another a long time. We’ve gotten to know each other a lot better over the last five days -- and that says a lot,” Boras said. “These negotiations are more of a cooperative venture as you’re dealing with medical, legal. The goal is common, very mutual. We all wanted to execute an agreement that we all thought was in the best interest of both J.D. and the Red Sox.”

But to fully understand the twists and turns of the road Martinez took to finally land in the middle of the Red Sox batting order, you have to go back to last autumn.

With free agency looming and his earning power at an all-time high after a career-best season, Martinez hired Boras to replace his longtime agent Bob Garber. Coldhearted? No doubt. But Boras has a track record of getting seven-year contracts for free-agent outfielders, from Matt Holliday and Jayson Werth to Shin-Soo Choo and Jacoby Ellsbury. And Martinez is entering his age-30 season, just like Holliday, Ellsbury and Choo were when Boras negotiated their deals.

Another relevant number: $27.5 million. That’s the average annual value of the four-year contract Yoenis Cespedes signed with the New York Mets before last season, a record for a free-agent outfielder. If Cespedes, who has 105 homers and an .841 OPS over the past four seasons, got $27.5 million per year entering his age-31 season, it seemed Martinez could make more after hitting 128 homers with a .936 OPS over that same span.

It was no surprise, then, that the teams that reached out to Boras early in the offseason got the impression he was seeking a contract in excess of $200 million for a hitter he dubbed “The King Kong of slugging.”

There was only one problem: The market for Martinez and so many other free agents -- including Boras clients Eric Hosmer, Jake Arrieta and Mike Moustakas -- never developed as everyone anticipated. More than 100 free agents were still looking for work when teams opened their camps two weeks ago. Boras landed Hosmer an eight-year deal with the San Diego Padres before finally securing Martinez’s deal with the Sox, but Arrieta and Moustakas are still unsigned.

Agents have accused the teams of colluding, a claim Red Sox owner John Henry dismissed as “ridiculous,” while players’ union chief Tony Clark has decried a competitive imbalance caused by what he describes as one-third of the teams having little or no interest in winning this year.

“There’s a lot of factors that have driven this offseason,” Henry said, not referring specifically to Martinez’s situation. “You just can’t expect every offseason to be a feeding frenzy.”

From castoff to 'King Kong'

How J.D. Martinez became one of MLB's most sought-after sluggers. Lauber »

The Arizona Diamondbacks wanted to re-sign Martinez, who slugged 29 homers in a 62-game binge after they traded for him last July. But they couldn’t afford to keep Martinez and still have money to lock up All-Star first baseman Paul Goldschmidt after next season, not as long as ace Zack Greinke's hefty contract remains on the books.

“The offseason for J.D. was like a river with a dam. A lot of water behind it. The question is, when were the gates going to open up,” Boras said. “You kept getting the calls, the interest, the dynamic -- we may do this, we may do that -- and so that part hadn’t filtered through.”

In December, Martinez drove from his Miami-area home to the winter meetings in Orlando and met for several hours with Red Sox officials, including new manager Alex Cora and special assistant Jason Varitek. Although Boras says “it was very clear there was a fit,” the agent is also well-known for his patience. Rather than rushing into deals early in the offseason, he often advises clients to wait while the market builds.

But with most of the usual big spenders, namely the Yankees and Dodgers, sitting out free agency -- perhaps in preparation for next year’s Bryce Harper/Manny Machado/Josh Donaldson class -- the action didn’t pick up in January as much as it has in past years.

Dombrowski, meanwhile, read the market correctly. The Red Sox offered Martinez a five-year contract worth about $100 million, then sat back and waited. Although chairman Tom Werner said in January the team was in “active negotiations” with Martinez, Dombrowski refused to bid against himself, even claiming throughout the offseason he was content to open the season with the same lineup that produced the fewest homers in the American League last year.

But for as much as Martinez needed the Red Sox, the Red Sox needed Martinez, not only to bring the middle-of-the-order thunder they have lacked since David Ortiz retired 16 months ago but also as a counterpunch to the Yankees’ pairing of Stanton and Aaron Judge. Once Boras was willing to negotiate, the Sox upped their offer slightly.

Really, though, it was the structure of the deal -- in particular, the three opt-outs -- that got it done. Martinez can re-enter the free-agent market after the 2019, 2020 or 2021 season, essentially giving him a chance to get out of the contract if he doesn’t like Boston, a sports-obsessed market that isn’t for everyone (ask Carl Crawford, Pablo Sandoval and Price).

Martinez didn’t wind up topping Cespedes’ annual salary. But by getting the Sox to pay 45 percent of the money ($50 million) this season and next, Boras can also boast of a $25 million AAV for the first two years of the contract, which beats Angels outfielder Justin Upton's $22.125 million AAV from a free-agent deal signed in 2016.

And if Martinez remains one of the most productive sluggers in baseball, he has an opportunity to go back out on the market as soon as the winter of 2019-20, one year after the Harper/Machado/Donaldson group. Martinez will be 32 then, and with three years and $60 million left on the contract, Boras would be aiming to top the deals signed by Edwin Encarnacion and Carlos Santana in the past two offseasons.

If Martinez needed to be talked into joining the Red Sox, he got positive reviews from Price and right-hander Rick Porcello, both of whom were his teammates in Detroit.

“I talked to him a couple times,” Price said. “I told him we’d love to have him here.”

Martinez also has history with Dombrowski, who was running the Tigers' baseball operations in 2014 when Detroit signed Martinez after he'd been released by the Houston Astros.

In the end, though, it was a matter of signing with the team that needed him most and proved it with a nine-figure offer.

“Talking to Alex [Cora] about going out there every day, it’s almost like -- football has Monday night. They said at Fenway that every night is like Monday Night Football,” Martinez said. “I love this game, I love to play. To play in front of fans that are just as passionate and love it just as much is exciting.”