SAN FRANCISCO — Mike Moustakas hit his 18th home run leading off the second inning, Jorge Bonifacio and Lorenzo Cain followed with back-to-back shots in the third and the Kansas City Royals beat the San Francisco Giants 7-2 on Wednesday to complete a two-game sweep.

Bonifacio finished with two hits and three RBIs, Whit Merrifield added three hits and three runs while Alcides Escobar singled three times to help Jason Hammel end an eight-game winless stretch on the road that dated to 2016.

Hammel (3-6) allowed one run over 6 2/3 innings to beat the Giants for the first time in 12 starts. The right-hander gave up eight hits, struck out four and walked one.

Moustakas, one of Kansas City’s top hitters over the past two weeks, stayed hot with his home run off former Royals pitcher Johnny Cueto (5-6) that landed in the waters of McCovey Cove. It was the fifth homer in 12 games for Moustakas, who is already just four shy of his career-high.

MARLINS 11, ATHLETICS 6

MIAMI — Marcell Ozuna homered to start the Miami Marlins’ comeback from an early four-run deficit, and they beat the Oakland Athletics 11-6 Wednesday to complete a two-game sweep.

Ozuna hit his 17th home run to start the second inning, added a double and had three RBIs. Tyler Moore hit his fifth homer and scored three times to help the Marlins overcome a wobbly outing by Edinson Volquez, who had a no-hitter in his most recent home start.

Ichiro Suzuki had a pinch-hit single in the fifth for his 365th interleague hit, breaking Derek Jeter’s major league record.

Ryon Healy hit a three-run homer for the Athletics (27-38), who fell to 11 games below .500 for the first time. They went 1-5 on their trip and lost their ninth consecutive road series, their longest such streak since 1986.

Oakland lost after leading by three or more runs three times on the trip. Daniel Gossett (0-1) couldn’t hold a 4-0 lead in his major league debut after being called up from Triple-A Nashville, and allowed seven runs, six earned, in 3 1-3 innings.

Kyle Barraclough (2-1), the first of six Miami relievers, pitched a scoreless fifth.

RED SOX 7, PHILLIES 3

PHILADELPHIA — Mookie Betts homered twice and Xander Bogaerts had three RBIs to help the Red Sox beat the Phillies.

Betts had four hits and drove in three to lead an offensive barrage off Phillies starter Jeremy Hellickson (5-5). Boston tagged him for six runs on nine hits in just five innings.

Betts led off the game with a single, had an RBI double in the second, but his biggest hit was a solo home run, his 10th of the season, in the fourth inning after the Phillies had scored three runs to close within 5-3.

He had a chance to get the cycle in the ninth inning, but instead of a triple connected for home run No. 11 to put the game out of reach. It was his eighth career multi-homer game.

Betts was dazzling defensively as well, and made a stellar diving catch in right field to rob Howie Kendrick of a hit in the fifth inning.

BLUE JAYS 7, RAYS 6

TORONTO — Russell Martin hit a tiebreaking home run in the bottom of the eighth inning to lift the Blue Jays to a 7-6 victory over the Rays.

Kendrys Morales homered among his two hits and drove in four runs for the Blue Jays, who won after giving up a three-run lead in the top of the eighth.

Trailing 6-3, the Rays tied it on Logan Morrison’s 19th homer, a two-run shot off reliever Joe Smith (3-0) and Derek Norris’ sacrifice fly.

Martin then connected for his sixth home run of the season off reliever Jose Alvarado (0-1) over the center-right-field fence in the bottom half.

Roberto Osuna ensured it stood up in the ninth, finally forcing Evan Longoria to pop out to second base to earn his 17th save of the season.

Tampa Bay lost for just the second time in eight games.

DIAMONDBACKS 2, TIGERS 1

DETROIT — Taijuan Walker pitched five sharp innings in his return from the disabled list, and the Diamondbacks won their fourth straight game, beating the Tigers.

Walker (5-3) allowed a run and six hits in his first appearance since May 19. He had been out because of a blister on his right index finger.

The Diamondbacks scored two runs in the first inning, and that turned out to be all they needed. Walker was lifted after 82 pitches, but Randall Delgado pitched three scoreless innings of relief. Fernando Rodney struck out the side in the ninth for his 18th save in 21 chances.

Jordan Zimmermann (5-5) allowed two runs and six hits in eight innings.

Arizona is 9-1 in interleague play this season. The lone defeat was at home May 10 against Detroit.

PADRES 4, REDS 2

SAN DIEGO — Franchy Cordero’s go-ahead single in the seventh inning capped a comeback that included Hunter Renfroe’s two-run homer, sending the Padres to a sweep-completing victory over the Reds.

Jhoulys Chacin (6-5) pitched seven innings, allowing five hits and two runs.

With the score 2-2 after Renfroe’s tying shot an inning earlier, Padres pinch-hitter Matt Szczur and Jose Pirela scored after drawing walks against reliever Michael Lorenzen (3-2) to open the seventh.

The Reds, who have lost their past eight road games, were swept at both Dodger Stadium and Petco Park to go 0-6 on the West Coast trip.

Cordero, a rookie center fielder who made his major league debut May 27, hit three home runs in the series and knocked home Szczur with a single to right field.

BRAVES 13, NATIONALS 2

WASHINGTON — Kurt Suzuki homered, Julio Teheran earned his third consecutive victory and the Braves defeated the Nationals to earn a rare series victory on the road against their NL East rival.

Brandon Phillips had four hits and three RBIs for the Braves, who had dropped seven consecutive road series against the Nationals and had lost 23 of their last 25 games in Washington before taking two of three this week.

Braves outfielder Matt Kemp left the game in the third inning after suffering an apparent leg injury while sliding into third base.

Atlanta was in control from the start against Washington starter Tanner Roark (6-4), who gave up two runs before he recorded an out and three total in the first inning.

The Braves would add three more in the third, with Nick Markakis scoring from third after Nationals catcher Jose Lobaton’s pickoff attempt of Kemp caught first baseman Ryan Zimmerman off guard and sailed into right field. Kemp was thrown out and injured at third on the play.

ROCKIES 5, PIRATES 1

PITTSBURGH — Ian Desmond hit his fourth home run of the season and rookie German Marquez pitched effectively into the sixth inning as the Rockies beat the Pirates to snap a three-game losing streak.

Marquez (5-3) gave up one run and four hits in five-plus innings as the Rockies avoided being swept for the first time this season. Raimel Tapia went 4 for 4 and scored three times for Colorado. Jake McGee bailed the Rockies out of a bases-loaded, one-out jam in the seventh. Colorado picked up its major-league best 25th road win.

The Pirates managed just one extra-base hit and left eight men on as their season-high four-game winning streak came to an end.

Chad Kuhl (1-6) remained winless since the first week of the season. He gave up three runs in five innings and his ERA sits at 5.61 through 12 starts.

METS 9, CUBS 4

NEW YORK — Curtis Granderson opened a five-run eighth inning with his 300th homer, a tiebreaking shot that helped the Mets rally past the Cubs.

Injury replacement Lucas Duda added a three-run homer off Hector Rondon, and T.J. Rivera capped the outburst with an RBI single for his third hit.

With sluggers Yoenis Cespedes and Michael Conforto on the bench to begin the game, the resurgent Mets came back from a 4-1 deficit and took two of three from the defending World Series champions despite losing second baseman Neil Walker to a left leg injury.

Granderson received a standing ovation and came out for a curtain call after connecting in the eighth off Carl Edwards Jr. (2-1).

Jerry Blevins (4-0) struck out three of his four batters to earn the win.

DODGERS 6, INDIANS 4

CLEVELAND — Cleveland relief ace Andrew Miller gave up a tiebreaking home run for the second straight night — a solo shot to pinch-hitter Kike Hernandez in the eighth inning — and the Dodgers defeated the Indians.

Hernandez, batting for Chase Utley, hit a 1-2 pitch that barely cleared the wall in right field. Hernandez pumped his fist as he rounded first base after his homer gave Los Angeles a 3-2 lead.

Miller (3-2) wore a shocked expression as he walked to the left of the mound after the home run. The left-hander, who has been virtually unhittable, allowed a leadoff homer to Cody Bellinger in the eighth — the first he gave up this season — that broke a tie in the Dodgers’ 7-5 win Tuesday.

Miller was charged with four runs in 2/3 of an inning after throwing 25 pitches Tuesday and the Indians (31-31) dropped to .500 for the first time since April 19.

ASTROS 13, RANGERS 2

HOUSTON — Derek Fisher homered and had an RBI single for his first major league hits in a nine-run sixth inning to help the Houston Astros to a victory over the Rangers to avoid a three-game sweep.

The Astros led by three with no outs in the sixth when Fisher, who made his debut on Wednesday, connected off Jeremy Jeffress for a solo home run to the seats in left field. Two pitches later, Jake Marisnick hit a pitch into nearly the same spot to extend the lead to 6-1.

Houston had pushed the lead to 10-1 when Fisher came up again with two outs in the inning. This time he laced a single to right field to send another run home.

But the Astros weren’t done scoring in that inning yet. Dillon Gee plunked Marisnick before George Springer added a two-run double to make it 13-1. The Rangers finally escaped the sixth when the 13th batter of the inning, pinch-hitter Alex Bregman, grounded out.

MARINERS 6, TWINS 4

MINNEAPOLIS — Mitch Haniger and Mike Zunino homered against Ervin Santana early, and the Mariners bullpen held off the Twins late.

Ben Gamel added three hits and two runs for the Mariners, who have won 12 of 17 games. Rookie Sam Gaviglio picked up the win by pitching into the sixth inning, and four relief pitchers combined to close the door on the Twins’ attempt to come back from a 5-0 deficit.

Edwin Diaz recorded four outs and dealt with a scare in the ninth inning to pick up his 11th save in 13 opportunities and bring Seattle one win away from the .500 mark.

The Mariners never trailed, grabbing the lead before Santana recorded an out when Haniger drove a two-run homer to left. Two innings later, Zunino continued his hot hitting with a three-run homer off the facing of the second deck in left-center field to give Seattle a five-run lead. Zunino is hitting .396 since May 29 with four homers against the Twins in that span.

ANGELS 7, YANKEES 5

ANAHEIM, Calif. — Shortstop Andrelton Simmons hit a two-run homer in the seventh inning to break a tie and lead the Angels to a victory over the Yankees.

Simmons fell to one knee to hit his seventh home run and ruined the major league debut of New York right-hander Ronald Herrera (0-1).

Danny Espinosa hit a two-run homer for the Angels, and Gary Sanchez a three-run shot for the Yankees.

Blake Parker (2-2) earned the victory in relief. Angels starter Matt Shoemaker left the game in the fourth inning with what the team called tightness of his right forearm extensor muscle.

David Hernandez pitched a scoreless ninth to earn his first save of the year.

BREWERS 7, CARDINALS 6

ST. LOUIS — Eric Thames homered and drove in three runs, Matt Garza pitched five innings in his first start after a short stint on the disabled list, and the Brewers beat the Cardinals.

Eric Sogard added a two-run double to lead a four-run second inning as Milwaukee improved to 18-13 on the road.

Aledmys Diaz hit a two-run homer for the Cardinals, losers of two in a row after winning four straight.

Closer Corey Knebel came on with two outs in the top of the eighth after a one-hyour rain delay and got the last four outs for his 10th save in 13 chances.

Thames, who entered the game in a 1-for-15 skid, had a two-run homer in the first and an RBI double in the second against starter Mike Leake (5-6).

Garza (3-2) allowed four runs and five hits.

ORIOLES 10, WHITE SOX 6

CHICAGO — Welington Castillo hit a grand slam and drove in a career-high five runs, and the Orioles snapped a six-game losing streak with a rain-delayed victory over the White Sox.

Castillo gave the Orioles an 8-5 lead with his drive against Miguel Gonzalez (4-8) in the fifth inning and helped prevent them from matching their longest slide of the season. Baltimore also evened its record at 32-32 after falling below .500 for the first time since Oct. 3, 2015.

Matt Davidson homered in his third straight game to help Chicago grab an early 5-1 lead. But the Orioles turned this one around, pounding out 13 hits on the way to a lopsided victory.

Trey Mancini had a double and two singles. He scored three runs and drove in one.

Mark Trumbo added two hits and two runs, and a shaky Dylan Bundy (7-5) got the support he needed.