CHICAGO (AP) — Jeurys Familia escaped a bases-loaded jam with a game-ending double play after Rene Rivera drove in the tiebreaking run with two outs in the top of the ninth, lifting the New York Mets over the Chicago Cubs 2-1 on Tuesday night.

Familia walked Addison Russell and Miguel Montero to start the ninth, then Javier Baez reached on a bunt single when third baseman Jose Reyes threw wide to first. Pinch-hitter Matt Szczur hit a grounder to first baseman James Loney, and Loney threw out Russell at the plate. Kris Bryant then hit into a 5-4-3 double play to give Familia his 33rd save in 33 chances.

Rivera had the third single in the ninth — following hits by Loney and Asdrubal Cabrera — off Hector Rondon (1-2) as the Mets beat the Cubs for the fifth time in six games after sweeping them in last year’s NL Championship Series.

Hansel Robles (4-3) pitched two scoreless innings in relief for the win.

RED SOX 4, GIANTS 0

BOSTON (AP) — David Ortiz hit a three-run homer and Rick Porcello remained unbeaten at home as Boston beat struggling San Francisco.

Brock Holt also homered for the Red Sox, who won for the seventh time in eight games. The NL West-leading Giants remained winless since the All-Star break with their fourth straight loss.

Porcello (12-2) scattered four hits over 6 1-3 innings, improving to 9-0 at home.

Jake Peavy (5-8), a key member of Boston’s 2013 World Series champions, struck out six over six innings and held his former teammates to three hits, but two left the park.

The Giants played at Fenway Park for the first time since 2007.

DODGERS 8, NATIONALS 4

WASHINGTON (AP) — Chase Utley drove in three runs with three hits, including a leadoff homer that quickly spoiled the major league debut of Reynaldo Lopez and sent Los Angeles over Washington.

Los Angeles swept three games from Washington at home in June and has won six straight in the series.

Scott Kazmir (8-3) gave up one run and four hits in seven innings, striking out eight. He extended his unbeaten streak to 12 starts, going 6-0 in that span.

Lopez (0-1), considered one of Washington’s top prospects, allowed six runs and 10 hits in 4 2/3 innings. He struck out nine, featuring a fastball in the upper 90s mph.

PIRATES 3, BREWERS 2

PITTSBURGH (AP) — Josh Harrison tripled leading off the bottom of the ninth and scored when the throw from the outfield skipped past Milwaukee third baseman Hernan Perez and out of play to lift Pittsburgh.

Perez’s RBI single off Pittsburgh All-Star closer Mark Melancon (1-1) with two outs in the ninth tied the game, but the tie was short-lived. Harrison’s drive off Tyler Thornburg (3-4) was just out of the reach of Milwaukee center fielder Kirk Nieuwenhuis. Harrison chugged to third then popped up and strolled home when the relay throw from second baseman Scooter Gennett went by Perez.

Pirates rookie Jameson Taillon pitched six innings in his return from the disabled list, narrowly avoiding serious injury after taking a 105 mph line drive off his head in the second. The 24-year-old rookie lay on the ground for several moments while being tended to by trainers but was permitted to stay in the game.

MARLINS 2, PHILLIES 1, 10 INNINGS

PHILADELPHIA (AP) — Christian Yelich homered and drove in the winning run with a single in the 10th inning.

J.T. Realmuto added two hits for the Marlins, who won their third straight to remain one game ahead of the New York Mets for the second wild-card spot in the National League.

Adeiny Hechavarria opened the 10th with a double off David Hernandez (1-3). After Hernandez walked Martin Prado to put runners on first and second with two outs, Phillies manager Pete Mackanin lifted Hernandez so left-hander Daniel Stumpf could face the left-handed Yelich.

Yelich put Miami in front by lacing Stumpf’s 3-2 pitch to left field, easily scoring Hechavarria.

A.J. Ramos pitched a scoreless 10th for his 31st save in 32 opportunities.

Mike Dunn (2-1) tossed a 1-2-3 ninth to earn the victory.

INDIANS 7, ROYALS 3

KANSAS CITY, Mo. (AP) — Danny Salazar handled the Royals for the third time this season while the Cleveland Indians roughed up Kansas City’s starter-by-committee.

Salazar (11-3) allowed three runs over 6 2-3 innings while striking out seven.

Mike Napoli hit a two-run homer off Brian Flynn (1-1), and Carlos Santana drove in two runs.

Francisco Lindor also homered as the AL Central leaders snapped a five-game skid at Kauffman Stadium.

BLUE JAYS 5, DIAMONDBACKS 1

PHOENIX (AP) — Edwin Encarnacion hit his 25th home run and Aaron Sanchez pitched seven strong innings for Toronto.

Sanchez (10-1), pitching on nine days’ rest thanks to the All-Star break, allowed a run and scattered six hits to improve to 9-0 in his last 15 starts. He struck out five with no walks and hit two batters.

Zack Godley (2-1), called up from Triple-A Reno to make the start for Arizona, went five innings, giving up four runs, three earned, and six hits. He struck out seven and walked one.

YANKEES 7, ORIOLES 1

NEW YORK (AP) — Starlin Castro hit a two-run homer and drove in four runs, Nathan Eovaldi won for the first time since May and New York beat Baltimore to move back above .500.

The AL East-leading Orioles have lost three in a row.

Castro homered in the second off Vance Worley (2-1) and hit a two-run double in the sixth. Chase Headley added a two-run homer in the eighth.

Making his first start since July 1 following three relief outings caused by a six-start winless streak, Eovaldi (8-6) won for the first time since May 29.

ANGELS 8, RANGERS 6

ANAHEIM, Calif. (AP) — Albert Pujols hit a pair of three-run homers and Los Angeles remained unbeaten since the All-Star break with its season-best fifth straight victory.

Pujols connected in the fourth and fifth innings against Kyle Lohse (0-2) for his second multi-homer game in three days, driving in six runs for the first time since 2009.

Pujols’ homers were the 578th and 579th of his career, pulling him closer to Mark McGwire (583) for 10th place on baseball’s career list.

Tim Lincecum (2-3) had seven strikeouts while winning for the second time in his six starts for the Angels. Huston Street pitched the ninth for his eighth save — his first since June 14.

ATHLETICS 4, ASTROS 3, 10 INNINGS

OAKLAND, Calif. (AP) — Marcus Semien scored from second base on Josh Reddick’s two-out infield single in the 10th inning to lift Oakland.

The A’s rallied from three runs down and trailed 3-2 before Coco Crisp’s game-tying double off Astros closer Will Harris in the ninth.

After the Astros stranded the bases loaded in the top of the 10th, Reddick won it with the sixth walkoff hit of his career.

Semien singled with two outs off Pat Neshek (2-2) and stole second. Yonder Alonso walked before Reddick singled to deep shortstop. Houston’s Carlos Correa fielded the ball cleanly but threw wide of home as Semien slid safely in with the winning run.

Mark Rzepczynski (1-0) got the last out in the top of the 10th for the win.

WHITE SOX 6, MARINERS 1

SEATTLE (AP) — Melky Cabrera hit a tie-breaking homer leading off the seventh inning, Todd Frazier added a two-run shot in the ninth and Chicago snapped a five-game losing streak.

Cabrera lined his ninth home run of the season just over the wall in left field off Seattle starter Wade Miley (6-7) to snap a 1-1 tie.

Chicago starter Jose Quintana (8-8) threw six innings and his only major mistake was Robinson Cano’s 22nd home run in the fourth inning.

TWINS 6, TIGERS 2

DETROIT (AP) — Tommy Milone held Detroit scoreless until the ninth inning, and Minnesota broke through with five runs in the seventh.

Brian Dozier hit a two-run homer and Eduardo Nunez had three RBIs.

Milone (3-2) left in the ninth. Down 6-0 at the start of the inning, Detroit scored twice and loaded the bases with one out. Brandon Kintzler struck out James McCann and Jose Iglesias to end it.

Anibal Sanchez (5-11) struck out 10 in six-plus innings.

RAYS 10, ROCKIES 1

DENVER (AP) — Blake Snell held Colorado to one hit over six strong innings, Evan Longoria homered and drove in three runs and Tampa Bay ended an 11-game road losing streak.

Snell (2-4) struck out nine and Matt Andriese pitched the final three innings for his first save. Steve Pearce also homered in his return from the disabled list for the Rays, who ended the third longest road losing streak in club history.

They broke out against Rockies starter Tyler Chatwood (8-6).

BRAVES 5, REDS 4, 11 INNINGS

CINCINNATI (AP) — Atlanta’s bullpen blew a two-run lead in the ninth inning, but Ender Inciarte hit a sacrifice fly in the 11th that evened a series between the NL’s worst teams.

Nick Markakis started the winning rally with a single off Tony Cingrani (2-3) and took third on Jeff Francoeur’s single off Blake Wood. Inciarte’s fly to deep center broke the tie.

Mauricio Cabrera (1-0) got the last five outs for his first career win.