DETROIT — Victor Martinez hit a two-run homer in the seventh inning and the Detroit Tigers held off David Ortiz and the Red Sox after that, beating Boston 7-6 on Saturday night.

Ortiz had three hits, including a home run in the sixth. His two-run single in the seventh gave Boston a 6-5 lead, but Martinez answered with a long drive down the right-field line off reliever Junichi Tazawa (2-5).

Rajai Davis also homered for the Tigers, and Ian Kinsler and James McCann had three hits apiece. Blaine Hardy (4-2) won in relief.

Bruce Rondon pitched a hitless ninth for his first save of the season. He walked Ortiz with two outs before striking out Pablo Sandoval.

Blake Swihart had three hits for the Red Sox.

The Tigers have gone through a tumultuous couple of weeks. They traded David Price and two other key players before the July 31 deadline, and General Manager Dave Dombrowski was let go Tuesday. On Friday, McCann and shortstop Jose Iglesias got into an altercation in the dugout.

Detroit fell behind 2-0 but eventually prevailed in an entertaining, back-and-forth game. Davis hit a two-run homer to tie it in the fifth, only to have Ortiz answer with a solo shot in the sixth.

In 54 games at Comerica Park, Ortiz has 21 homers, the most by a visiting player.

J.D. Martinez tied it in the bottom of the sixth with an RBI double and later came home on a wild pitch. McCann’s run-scoring double made it 5-3.

With the score 5-4 and the bases loaded with two outs in the seventh, Hardy replaced Detroit starter Alfredo Simon. Ortiz grounded a single up the middle to put the Red Sox back ahead.

But Victor Martinez, after pulling a couple of hard line drives foul, connected off Tazawa to give the Tigers the lead for good.

NOTES: Mookie Betts, returning from a concussion, will play Sunday for the Portland Sea Dogs at Akron. It’s expected to be a one-game rehab with Betts rejoining the Red Sox on Tuesday at Miami. … Red Sox left fielder Hanley Ramirez was a late scratch because of a sore left foot. … Boston was without closer Koji Uehara, hit on his pitching arm by a line drive the previous night. Manager John Farrell said it might be a stretch to bring Uehara back at all this weekend.

SEVEN INNINGS into Game 3 of the 2013 AL Championship Series, the Red Sox were locked in a scoreless game at Comerica Park. Up stepped Mike Napoli against Tigers ace Justin Verlander and out went the ball, 402 feet to left, the only run in a 1-0 win.

There was something oddly apropos, then, that the Red Sox were back in Detroit, back at Comerica on Friday night when Napoli’s tenure with the team came to an unceremonious close. In the midst of the worst season of his 10-year career, with his contract set to expire, he was scratched minutes before the opener of a three-game series and traded to Texas for a player to be named or cash. The Sox also agreed to subsidize some of the approximately $5.25 million still coming to the 33-year-old first baseman this year.

So that’s really how it ends for a player whose Red Sox career mirrored the championship season he played such a central role in shaping: Filled with high points and all too fleeting.

“He was in the middle of some real key moments,” General Manager Ben Cherington said. “It worked out really well. We had an opportunity to re-sign him and he wanted to do that after 2013, and obviously our hope at that time was we would continue to have team success and he would be a big part of that. It hasn’t worked out.”