After months of negotiations, and another weak of final tweaking, the Red Sox have officially signed slugger J.D. Martinez. ESPN.com’s Pedro Gomez first tweeted that a deal was in place; Jon Heyman of FanRag Sports had tweeted that the sides were close. Martinez is represented by the Boras Corporation.

The contract is for five years and $110MM, per reports. Notably, it includes three opt-out opportunities — after the second, third, and fourth seasons of the deal. As Evan Drellich of NBC Sports Boston tweets, Martinez will receive $23.75MM annual salaries for the first two years and is promised a $2.5MM buyout if he opts out of the remainder of the deal. He’ll also earn $23.75MM for the third season of the contract. At that point, he’ll choose between a return to the open market (with no buyout) and $19.35MM salaries for 2021 and 2022.

But that’s not all. The original deal only included two opt-outs and did not protect the Red Sox in the event of injury. After a physical and ensuing additional negotiations, the pact now contains not only a third opt-out but also some language allowing Boston to avoid certain obligations if Martinez’s prior Lisfranc injury recurs, as we detailed here. There’ll also be some limited no-trade protection, as Heyman tweeted originally. Martnez can designate a “small” number of teams to which he cannot be moved without his consent.

Boston has been the primary suitor connected to Martinez for virtually all of the offseason — especially since their decision to re-sign Mitch Moreland effectively took them out of the Eric Hosmer sweepstakes. Martinez figures to slot in as the primary DH for the Sox but should see some occasional time in the outfield when any of Andrew Benintendi, Jackie Bradley or Mookie Betts needs a breather. His addition calls the role of Hanley Ramirez with the Red Sox into question, as Ramirez now appears to be, at best, a backup DH and a part-time first baseman that is on the short side of the platoon.

[RELATED: Updated Red Sox Depth Chart]

Though the Sox have a substantial commitment to Ramirez already in place, that didn’t stop them from making a sizable offer to bring Martinez into the fold, and it’s not difficult to see why they felt he was a key piece to pushing into World Series contention. Martinez slashed a Herculean .303/.376/.690 with 45 home runs and 26 doubles in just 489 plate appearances last offseason. In all, an out-of-the-blue breakout with the 2014 Tigers, Martinez has been one of the game’s most feared hitters — as evidenced by the .300/.362/.574 batting line he’s logged in that four-year period.

Context-neutral metrics like OPS+ (149) and wRC+ (148) feel that the 30-year-old Martinez has been nearly 50 percent better than the league-average hitter in that time, when adjusting for park and league. That 148 wRC+ ties him with Bryce Harper and now-former teammate Paul Goldschmidt for fourth in all of baseball over the past four years; only Mike Trout, Joey Votto and Giancarlo Stanton have posted better wRC+ marks in that time.

The Red Sox ranked 10th in the Majors in runs scored last season as it was, though their combined .258/.329/.407 batting line was below-average on a rate basis, and they ranked 27th in the Majors with 168 homers. Martinez will serve as a particularly potent upgrade in the DH department, as Boston designated hitters combined to hit just .244/.327/.419 last year.

Clearly, the contract isn’t quite as massive as many had anticipated coming into the season. Martinez’s camp was said to be seeking over $200MM at the outset of free agency; MLBTR predicted that Martinez could reach $150MM in guaranteed money. As things developed, there just wasn’t sufficient demand around the game to drive a real bidding war. The Diamondbacks reportedly made a real run to keep Martinez, but never figured to have a war chest large enough to really push Boston’s offer up.

Martinez’s new deal also reflects a broad devaluation of one-dimensional sluggers. For instance, Edwin Encarnacion — an equally gifted hitter who became a free agent last year at a more advanced age — did not earn as large or long a deal as had been expected.

To be fair, Martinez offers more function on defense than does Encarnacion, as he’s still capable of lining up in the corner outfield. But metrics have soured on his glovework. Though both UZR and DRS viewed Martinez as an above-average presence in 2015, they graded him as one of the game’s worst fielders in the ensuing campaign. He bounced back last year, but still drew below-average marks in right field. Fangraphs’ BsR measure also values Martinez as an exceedingly poor baserunner.

Those aspects of Martinez’s game created some drag on his market value. But the Sox surely aren’t that concerned with how good Martinez will be in the outfield. Presumably, he’ll stay fresh by limiting his exposure to the grass, which may boost his output when he is asked to take the field. Regardless, the contract values Martinez for his anticipated contributions with the bat.

Contract details were reported by Alex Speier of the Boston Globe (contract length; Twitter link), ESPN.com’s Pedro Gomez (opt-out clause, on Twitter), Jon Morosi of MLB Network (total guarantee, via Twitter), Jon Heyman of Fan Rag (salary in first two years & second opt-out, via Twitter), Jason Mastrodonato of the Boston Herald (second opt-out details), and Evan Drellich of NBC Sports Boston (second opt-out details; Twitter link).

Photo courtesy of USA Today Sports Images.