Miguel Cabrera hit a two-run home run, Jarrod Saltalamacchia and Tyler Collins each had a pair of RBIs and the Detroit Tigers roughed up knuckleballer Steven Wright to beat the Boston Red Sox 9-8 on Tuesday night.

With the game tied in the sixth, Collins drew a bases-loaded two-out walk, which allowed Justin Upton to score the deciding run.

On a night when both starting pitchers struggled to string together outs, Detroit and Boston combined for 22 hits. Alex Wilson (1-0) got the victory, and Francisco Rodriguez closed for his 29th save.

David Ortiz had a three-run home run, but Boston’s offense didn’t have enough to offset a rare poor outing by Wright, who gave up nine hits and eight runs over 4 2/3 innings. Wright was leading the AL in ERA entering Tuesday.

Robbie Ross Jr. (1-2) got the loss.

Detroit scored early for the second straight night, this time taking the lead on Cabrera’s 20th homer of the season.

That was followed by RBI singles from Collins and Jose Iglesias in the second inning that made it 4-0.

Detroit starter Mike Pelfrey was solid the first time through the order but lost some of his early command the second time around.

It started in the third when Boston nearly erased Detroit’s lead with one big swing by Ortiz. With Mookie Betts and Xander Bogaerts aboard, Ortiz connected on a 3-2 pitch from Pelfrey to drive his 25th of the season over the right-field wall.

The Red Sox took the lead back an inning later on an RBI groundout by Brock Holt and RBI double by Betts.

The Tigers continued to get hits against Wright, and went back up 8-5 thanks a four-run fifth inning.

Boston kept chipping away and used Jackie Bradley Jr.’s home run and RBIs by Dustin Pedroia and Bogaerts to tie it in the sixth.

TRAINER’S ROOM

Tigers: OF J.D. Martinez, who has been sidelined since June 17 (non-displaced right elbow fracture) began his rehab assignment with Triple-A Toledo on Tuesday night. … LHP Daniel Norris (right oblique strain) will have his next rehab start in Double-A Erie on Thursday. He has been on the disabled list since July 5.

Red Sox: Manager John Farrell said LF/C Blake Swihart (left ankle sprain) is “ramping up activities” but because of some residual discomfort is not yet ready for a rehab assignment. The next seven to 10 days will be pivotal for him to determine his next step, Farrell said.

UP NEXT

Tigers: RHP Michael Fulmer (9-2, 2.41 ERA) makes his 16th start of the year in Wednesday’s series finale. It will be his first career start against the Red Sox. He is coming off a no-decision in his last start Friday against the White Sox, in which he surrendered five runs in five innings.

Red Sox: LHP Eduardo Rodriguez (2-4, 6.70) will make his third start since being recalled from the DL on July 16. He made his lone appearance against Detroit last season, allowing just one run and three hits over seven innings.