BOSTON — Tyler Collins walked with the bases loaded in the seventh inning to force in the winning run, and the Detroit Tigers edged the Boston Red Sox 9-8 Tuesday night at Fenway Park.

Collins worked a two-out, full-count walk from Red Sox reliever Robbie Ross Jr. (1-2), allowing Justin Upton to trot home from third.

Miguel Cabrera hit a two-run shot for his 20th homer of the season, and Jarrod Saltalamacchia had three hits and two RBIs for Detroit (53-48), which won for the fourth time in six games.

Tigers starter Mike Pelfrey pitched five innings, allowing five runs on six hits and two walks with a strikeout.

Alex Wilson (1-0) earned the win with a scoreless two-thirds of an inning. Francisco Rodriguez set down the Red Sox in the ninth to record his 29th save.

David Ortiz clubbed a three-run homer, his 25th of the year, and Jackie Bradley Jr. hit a solo shot for his 16th for Boston (55-43), which is 1-4 in its past five games.

Red Sox starter Steven Wright gave up a season-high eight earned runs on nine hits and three walks with two strikeouts in 4 2/3 innings.

Bradley’s solo blast over the bullpens in right field on an 0-1 pitch in the sixth brought Boston within 8-6 after the Red Sox blew a one-run lead they held through four innings.

Dustin Pedroia trimmed the deficit to one with his RBI single later in the inning, and Xander Bogaerts tied the game with a run-scoring groundout.

Wright put the Red Sox in an early hole, serving up Cabrera’s homer into the right field bullpens on a 1-1 pitch in the first inning.

Collins and Jose Iglesias each delivered RBI singles in the second to double the Tigers’ lead.

Ortiz made it a one-run game with his third-inning blast, which came on a 3-2 pitch from Pelfrey and sailed over the bullpens.

Brock Holt’s groundout an inning later tied it and Mookie Betts’ double the next at-bat gave Boston the lead.

Detroit ended Wright’s night with a four-run fourth.

Victor Martinez tied it with an RBI single before Nick Castellanos’ single loaded the bases.

Upton then ripped a single to first base that bounced off Hanley Ramirez’s glove, putting the Tigers on top again.

Ramirez recovered and flipped to Wright at first for the out before catching a Mike Aviles pop up for the second out.

However, Saltalamacchia laced a two-run single past diving second baseman Pedroia into center.

NOTES: Boston C Ryan Hanigan (flu-like symptoms) was a late scratch. Sandy Leon started and caught knuckleball pitcher Steven Wright. … Detroit CF Cameron Maybin (back) missed his third consecutive game. One of Maybin’s rib heads popped out and was put back in place. … Red Sox OF Chris Young (right hamstring strain) will “hopefully” be close to starting a rehab assignment when the team returns from its West Coast trip, manager John Farrell said. … Tigers RF J.D. Martinez (fractured right elbow) began a rehab assignment with Triple-A Toledo. Martinez will DH for two games and might play in the outfield Friday, manager Brad Ausmus said. … Detroit LHP Daniel Norris (oblique) had his rehab assignment transferred to Double-A Erie, and he will start Thursday. RHP Jordan Zimmermann (neck) will make his next rehab start Friday with Toledo. … Tigers RHP Michael Fulmer (9-2, 2.41 ERA) counters Red Sox LHP Eduardo Rodriguez (2-4, 6.70 ERA) in Wednesday’s series finale.

Rockies 6, Orioles 3

BALTIMORE — Colorado’s Carlos Gonzalez and Trevor Story had two RBIs apiece to lead the surging Rockies past the first-place Baltimore Orioles 6-3 on Tuesday night.

Colorado has won five of its past six games and rebounded from a disappointing series opener when they lost in the 10th inning on a throwing error by right-hander Jordan Lyles.

The Orioles’ Chris Tillman (14-3) fell short in his bid for a major league-leading 15th victory. He struggled early and often, allowing a season-tying high six runs on nine hits with four strikeouts over five innings. It was Tillman’s first loss in nearly a month, which also ended his team’s five-game winning streak.

Colorado’s Chad Bettis (9-6) put together another effective outing and contained the Orioles powerful lineup. He gave up just two runs on four hits with three strikeouts and three walks over six innings. The Rockies improved to 8-1 in the past nine starts by right-hander.

DJ LeMahieu had two hits, an RBI and two runs for Colorado

Adam Jones got his 18th home runs for the Orioles, who lead the major leagues with 149 on the year. Baltimore pulled to within 6-3 on wild pitch by reliever Boone Logan in the eighth. However, Carlos Estevez pitched a perfect ninth to pick up his ninth save.

The Rockies loaded the bases with one out in the third on three singles off Tillman. After Tillman got Nolan Arenado to pop out to third, Gonzalez delivered a ground-rule double to give Colorado a 2-0 lead. Story followed with a single to left that drove in two more runs.

All five of the Rockies’ hits came with two strikes. The four runs matched Tillman’s total in his past four games.