BOSTON — J.D. Martinez homered in his third straight game, rookie Michael Chavis singled home the winning run in the 10th inning and the Boston Red Sox recovered after blowing a five-run lead to beat the Colorado Rockies 6-5 on Wednesday night.

Martinez hit a two-run shot and Eduardo Rodriguez struck out 10 over six innings for the Red Sox, who won for the 12th time in 15 games. They split the two-game set to remain unbeaten (13-0-4) in their last 17 interleague series at Fenway Park.

Trevor Story had a two-run single and Tony Wolters doubled twice for Colorado, which had won four of five.

Xander Bogaerts opened the 10th with a double on the first pitch from Chad Bettis (1-3). After Rafael Devers was intentionally walked, Chavis hit a grounder up the middle on the next pitch.

Brandon Workman (3-1) struck out David Dahl with two runners on to end the top of the 10th.

A night after Boston ace Chris Sale became the first pitcher in major league history to strike out 17 batters in seven innings – and Colorado matched a franchise worst with 24 Ks – Rodriguez had the Rockies whiffing again. They ended up with 16 strikeouts.

But as on Tuesday when they rallied for a 5-4 victory in 11 innings, the Rockies overcame an early deficit.

Boston built a 5-0 lead with two runs in the first and three in the third against German Márquez, who entered 5-0 with a 2.02 ERA in nine career interleague starts.

Dahl had a sacrifice fly and Wolters a run-scoring double in the fourth to make it 5-2.

In the seventh, the Rockies loaded the bases with nobody out against Rodriguez. Ryan McMahon singled and Wolters doubled before Rodriguez plunked Charlie Blackmon with a pitch and was pulled. Matt Barnes gave up Story’s two-run single and, with Story running from first on a 3-2 pitch with one out, pinch-hitter Daniel Murphy bounced to second, scoring Blackmon to tie it.

Mookie Betts’ RBI single made it 3-0 before Martinez, unlike his other three homers the past four days that went over the Green Monster in left field, drove a slider into Boston’s bullpen in right.