BALTIMORE — Andrew Benintendi hit a two-run single in the 11th inning, Mookie Betts had four RBIs and the Boston Red Sox beat the Baltimore Orioles 10-8 Monday night for their ninth win in 12 games.

Xander Bogaerts homered and scored three runs for the Red Sox, who maintained their three-game lead over the second-place Yankees in the AL East and reduced to four their magic number for clinching a playoff berth.

Boston erased a five-run deficit with a six-run fifth inning and needed 10 pitchers to beat a skidding Orioles team that has now lost 10 of 12.

The Red Sox posted their major league-leading 14th win in extra innings against three losses.

Matt Barnes (7-3) pitched the 10th and Carson Smith got his first save. Miguel Castro (3-2) took the loss.

Red Sox second baseman Dustin Pedroia left in the fourth inning after being struck in the face by a foul ball he chopped off the plate. He bruised his nose and was listed as day to day. Earlier this year at Camden Yards, Pedroia’s knee was injured on a late slide by Manny Machado.

YANKEES 2, TWINS 1

NEW YORK — Aaron Judge hit his 44th home run, Aroldis Chapman pitched out of big trouble in the eighth inning and the Yankees edged Minnesota to increase their AL wild-card lead.

New York won the opener of a three-game series that could serve as a preview to the AL wild-card matchup in two weeks.

The Yankees trail AL East-leading Boston by three games, and hold a five-game edge over the Twins for league’s top wild card with 12 to play.

Chapman replaced a wild Dellin Betances with the bases loaded and one out in the eighth. The left-hander struck out three-time batting champion Joe Mauer and retired Byron Buxton on a fly, then closed for his 19th save.

Judge homered in the first off Ervin Santana (15-8). David Robertson (9-2) retired all four hitters he faced, improving to 5-0 since the Yankees reacquired him from the Chicago White Sox in July.

MARLINS 13, METS 1

MIAMI — Giancarlo Stanton hit his 55th homer — and his first in nine days — while driving in four runs to help Miami beat the Mets.

Batting third for the first time this year, Stanton hit a three-run line drive into the home run sculpture at Marlins Park in the fourth inning against Matt Harvey (5-6). With that, the MLB home run leader ended a drought of 29 at-bats without one.

Stanton’s homer total is the highest since Ryan Howard hit 58 in 2006. Stanton added a run-scoring single in Miami’s seven-run fifth.

The Marlins, back home after a trip extended by three games due to Hurricane Irma, won for only the fourth time in the past 21 games.

Dan Straily (10-9) gave up one run in five innings and struck out eight.

PADRES 4, DIAMONDBACKS 2

SAN DIEGO — Hunter Renfroe hit a three-run home run in his first game back from Triple-A and Austin Hedges also connected for the San Diego Padres, who beat NL wild card leader Arizona.

Renfroe drove a 1-1 pitch from lefty Patrick Corbin to straightaway center field with two outs in the first, his 11th. He was demoted to Triple-A El Paso on Aug. 18 to work on his hitting.

Corbin (14-13) retired the first two batters before allowing Wil Myers’ double that bounced over the fence in left-center. The pitcher then walked Yangervis Solarte before Renfroe connected.

Hedges homered to left-center on a 3-1 pitch with one out in the second, his 18th.

The Diamondbacks closed the gap in the third with RBI singles by David Peralta and J.D. Martinez off Luis Perdomo (8-10).

Brad Hand pitched the ninth for his 19th save.

PHILLIES 4, DODGERS 3

PHILADELPHIA — Aaron Altherr became the first big leaguer to hit a grand slam off Clayton Kershaw, leading Philadelphia over NL West-leading Los Angeles.

Kershaw (17-4) fell to 3-5 in his career against the Phillies.

Nick Pivetta (6-10) rebounded from a shaky start. Chris Taylor led off the game with an inside-the-park homer and Justin Turner followed with a drive over the wall.

Curtis Granderson homered in the ninth before Hector Neris got his 22nd save.

Former Phillies star Chase Utley went 0 for 2, striking out twice. He drew a standing ovation before his first at-bat and loud cheers throughout the evening.

BREWERS 3, PIRATES 0

PITTSBURGH — Brent Suter pitched five efficient innings, Ryan Braun homered and Milwaukee beat Pittsburgh.

The Brewers are two games behind Colorado for the second wild-card spot and 3 1/2 games in back of the NL Central-leading Cubs.

Suter (3-2) allowed five hits. Corey Knebel pitching the ninth for his 36th save in 41 tries.

Braun’s solo shot, his 17th of the season, came off Jameson Taillon (7-7).

ATHLETICS 8, TIGERS 3

DETROIT — Tigers reliever Jeff Ferrell left in the eighth inning after being hit in the head by a line drive off the bat off Ryon Healy measured at 102.6 mph.

Ferrell never went down, and instead immediately jogged toward the Detroit dugout. He was taken to a hospital for a precautionary CT scan. He was alert, responsive and walking under his own power, the Tigers announced after the game.

Matt Olson became the first Oakland player to homer in four straight games since Coco Crisp in 2013, and now has 14 home runs in his last 20 games.

Liam Hendriks (4-2) got the win with 1 2/3 scoreless innings. Buck Farmer (4-4) took the loss.