BOSTON — Rick Porcello’s unbeaten home season ended because of a hanging second-inning slider.

Mark Trumbo hit his major league-leading 42nd home run, Kevin Gausman narrowly outpitched Porcello over eight innings and the Baltimore Orioles pulled within a game of AL East-leading Boston with a 1-0 win over the Red Sox.

Baltimore took two of three in the series, but as disappointed as he was, Porcello took solace in Boston’s AL East lead.

“We lost and it’s a big game. There’s no satisfaction in that,” Porcello said. “This was big game for us. We were hoping to take the series from them, but that being said, we’ve still got a one-game lead and we get them for four at their place.”

The Orioles are headed back home and will host the Red Sox next week for four games that could push one team ahead to stay. Then again, the AL East looks like a four-horse race heading into the final weeks.

Baltimore moved one game ahead of slumping Toronto for the top AL wild card after the Blue Jays lost at home to Tampa Bay 8-1 earlier Wednesday. And then there are the Yankees, hanging around four games back of Boston. New York begins a four-game series at Fenway Park on Thursday night.

“A lot of big baseball to be played and we’re still in a good position,” Porcello said. “It’s going to be a lot of fun. This is what you train for. This is what you play for — to play meaningful baseball in September and hopefully into October.”

Gausman (8-10) and Porcello (20-4) had nearly identical line scores over eight innings, each striking out six and allowing just four hits, except Porcello allowed Trumbo’s leadoff shot in the second inning.

Porcello was 13-0 in home starts with one no decision entering the game.

“We have to score something to help him out,” said right fielder Mookie Betts, one of just four Boston players to get a hit. “If we score one or two we can get a win but we didn’t do that today. He did his job.

GREAT GOUSMAN

This was Gausman’s fourth scoreless outing in his past five starts and matched the longest start of his career. He threw 120 pitches and lowered his ERA to 3.43.

“He was just throwing all his pitches for strikes and keeping us off balance,” Betts said.

OUCH

Boston had a scare later in the second when J.J. Hardy hit a hard grounder up the middle and the ball bounced off Porcello’s calf to third baseman Travis Shaw. Hardy ran out the single while Porcello limped around the mound. The game was delayed briefly to allow Porcello a few warm-ups before continuing.

“It got me in a good spot. If it got me in the shin it might have been a little bit tougher,” Porcello said.

TRAINER’S ROOM

Red Sox: RHP Steven Wright (right shoulder strain) is expected to start throwing next week in Fort Myers, Florida. Manager John Farrell said the knuckleballer will need to gradually regain some arm strength and his return during the regular season is uncertain. “I don’t want to rule it out, but at this point it’s going to become a little bit more challenging with each passing day,” Farrell said.

UP NEXT

Red Sox: LHP Eduardo Rodriguez (2-7, 4.70) gets the start Thursday as Boston opens a four-game series against the New York Yankees. RHP Masahiro Tanaka (13-4, 3.04) is up in the visiting Yankees’ rotation.