J.D. Martinez and the Boston Red Sox have, at long last, come to an agreement.

The slow dance between the free agent slugger and the power-deficient team wrapped up Monday when they settled on a $110 million, five-year contract.

A person familiar with the negotiations told The Associated Press about the deal, speaking on condition of anonymity because it was subject to a successful physical and had not been announced. Martinez has the right to opt out of the contract early and become a free agent again.

Speculation that Martinez and the AL East champions would wind up together had been swirling ever since he became a free agent in November.

Boston was seeking to add power to a lineup that hit an AL-low 168 home runs last season. The 30-year-old Martinez has changed his swing to improve his launch angle and become one of the top home-run threats in the majors.

The move helps the Red Sox counter the huge deal their biggest rivals pulled off in December. The New York Yankees, who finished two games behind AL East champion Boston last year, acquired NL MVP Giancarlo Stanton – who led the majors with 59 home runs – in a trade with Miami. The 6-foot-6 Stanton joins a lineup with 6-7 Aaron Judge, the AL home run leader.

“We’re not conceding first place to anybody,” chairman Tom Werner said earlier in the day.

“I think it’s good for the rivalry. The Yankees have a very strong team and we have a very strong team, too,” he said. “If we’re healthy, I think we have the best pitching staff – starting pitching, ending with (Craig) Kimbrel – I think we’ve got the best pitching staff in the American League.”

Players say they’re looking forward to the challenge of facing the Yankees lineup.

“It doesn’t matter who you’re facing,” reliever Matt Barnes said. “You’ve got a guy who was the MVP and a guy that hit 50 home runs or however many Judge hit. You start throwing balls … and missing spots, it doesn’t matter, it’s the big leagues. They’re going to hit balls in the gap and balls over the fence.”

Martinez hit .303 with 45 homers and 104 RBI last year for Detroit and Arizona, which acquired him on July 18 for three prospects. He had 29 homers and 65 RBI in 62 games with the Diamondbacks, and hit a record-tying four home runs in a game.

Martinez started a combined 112 games in right field last year. He figures to become the primary designated hitter for the Red Sox, which would turn Hanley Ramirez into a platoon player at first base with Mitch Moreland.

The righty-swinging Martinez, who began his big league career with Houston in 2011, has played only seven career games at Fenway Park, batting .444 (12 for 27) without an RBI. He figures to knock in plenty of runs when he takes aim at the Green Monster in left field.

Martinez was among several prominent free agents still available over the weekend. Eric Hosmer is in the process of finalizing a $144 million, eight-year deal with San Diego while third baseman Mike Moustakas and pitchers Jake Arrieta and Alex Cobb are among the stars looking for places to play.