BOSTON — David Price took a shutout into the ninth inning and held Baltimore to five hits in his first complete game this season, leading the Boston Red Sox past the Orioles 6-2 on Thursday night.

J.D. Martinez hit a two-run homer in the first and Xander Bogaerts homered with two on during a four-run fifth, giving Price more than enough cushion against the struggling Orioles.

Price (4-4) struck out eight and didn’t walk a batter while winning consecutive starts for the first time this season. He cruised through the first eight innings before Andrew Susac led off the ninth with a double. Manny Machado spoiled the shutout with a two-out homer, but Price finished off Baltimore on Jonathan Schoop’s pop-up to center as the Red Sox improved to 4-0 against Baltimore.

Danny Valencia had a pair of hits for the punchless Orioles, who have lost 3 of 4 and have the second-fewest wins in the American League.

Kevin Gausman (3-3) went 42/3 innings for Baltimore, allowing six runs and eight hits. He was pulled after Bogaerts drove a high fastball out to left with two men on during Boston’s four-run fifth.

The Red Sox never trailed and went up 2-0 in the first when Mookie Betts led off with a single and Martinez hit his 13th homer of the season.

NOTES: Martinez left the game in the seventh with a stomach illness, the Red Sox said. … Second baseman Dustin Pedroia (offseason knee surgery) will resume a rehab assignment with Triple-A Pawtucket. Manager Alex Cora said it was possible Pedroia could make his season debut this month.