FORT MYERS, Fla. — It took an extra week but the Boston Red Sox finally got the big bat for the middle of their lineup they lacked last season.

J.D. Martinez and the Red Sox finalized a $110 million, five-year contract Monday, a week after the sides agreed to the deal pending a physical.

“It’s been a long process. I’m happy to just put everything behind me and be here today,” said Martinez, flanked by his agent, Scott Boras, and the Red Sox president of baseball operations Dave Dombrowski, at a Monday news conference at Boston’s spring training complex.

“I’m excited for the task at hand. I know this historic franchise and this organization, winning is No. 1 and bringing a championship back to Boston is the ultimate goal. I’m happy to now be a part of it.”

Martinez gets $27.5 million in each of the next three seasons and $19,375,000 in each of the final two. He can opt out after the second, third or fourth seasons, and there is a $2.5 million buyout if he opts out after 2019.

In 2017, the first season after David Ortiz retired, the Red Sox hit just 168 home runs, fewest in the American League and better than only the Atlanta Braves, Pittsburgh Pirates and San Francisco Giants.

Boston’s .407 slugging percentage was 26th in baseball, better than only the Los Angeles Angels in the AL.

The Red Sox hope that Martinez can help the team improve those stats, returning them to where they were during Ortiz’s tenure.

Martinez has primarily been a right fielder but with Boston will be the primary DH, with Hanley Ramirez and Mitch Moreland splitting time at first base.

Martinez, a right-handed batter and veteran of seven major league seasons with Houston, Detroit and Arizona, split 2017 with the Tigers and Diamondbacks.

In 119 games last season, he hit .303 with 104 RBI. His 45 home runs were third in the majors, while he posted a .690 slugging percentage. He will hit third or fourth in Manager Alex Cora’s lineup.

“He’s not only a home run hitter,” Cora said. “He’s a complete hitter. We not only got better lineup-wise and on the field, what he brings in that clubhouse, the way he prepares, I’m looking forward for him to connect with young players, help the young players. He did an outstanding job last year with the D-backs and that’s also something he’s going to bring. … That’s going to be an asset for us.”

Martinez was on the disabled list until May 12 last year with a sprained ligament in his right foot. Complications when he took his physical with Boston and language in the contract held up the announcement until Monday.

“At this time of year you’re in a spot where everybody’s not in one place for your physical,” Dombrowski said. “So (Martinez) actually did fly to Boston at one time to be checked out there because we just didn’t have all the doctors here that we needed. And then it was a matter of being in a position for us to complete the language of the contract.”

RED SOX 13, PIRATES 2: Andrew Benintendi scored twice and Rafael Devers got two hits for Boston at Bradenton, Florida.

Pittsburgh starter Ivan Nova struggled but Jameson Taillon pitched two shutout innings and struck out three.