NEW YORK - Starlin Castro hit a game-winning home run to lead off the bottom of the ninth, and the Yankees rallied to beat the Colorado Rockies 9-8 on Wednesday.

New York trailed 8-4 going into the seventh, but Carlos Beltran's three-run homer helped bail out CC Sabathia after his worst outing of the season.

It was the first career walkoff homer for Castro, who smashed the second pitch he saw from Jason Motte (0-1) to left field.

Sabathia had allowed just four earned runs total over his previous seven starts. He gave up five in 4 1/3 innings Wednesday.

Chase Headley also had a second-inning grand slam for the Yankees. Nick Hundley and Ryan Raburn homered for the Rockies.

Aroldis Chapman (1-0) pitched a perfect ninth for the win.

METS 4, ROYALS 3

Matt Reynolds snapped a sixth-inning tie with his first major league home run, leading Noah Syndergaard and New York past Kansas City a two-game sweep in their World Series rematch.

Asdrubal Cabrera homered for the second straight day and scored with an acrobatic slide to help Syndergaard (8-2) win his sixth consecutive decision. The only bad news for banged-up New York was another injury, this one to Yoenis Cespedes.

The star slugger had two hits and a walk, including a double off the centre-field wall, but was removed in the sixth because of discomfort in his left wrist.

Cheslor Cuthbert homered for the Royals, who had won eight of nine when they arrived at Citi Field. Joakim Soria (3-3) took the loss for Kansas City.

Addison Reed pitched the eighth, setting up Jeurys Familia for his major league-leading 24th save.

CARDINALS 7, CUBS 2

CHICAGO - Michael Wacha pitched into the seventh inning for his first win in nearly two months and St. Louis waited out Jake Arrieta before roughing up Chicago's bullpen in a victory over the Cubs.

Aledmys Diaz hit a two-run home run, and Matt Carpenter had a two-run double in a five-run sixth after Arrieta (11-2) left the game. The Cardinals won their eighth straight road game - their longest streak since 1982 - and completed their first three-game sweep at Wrigley Field since 1988.

Arrieta was charged with two runs - one earned - and four hits in five innings as he struggled with control (four walks) and pitch count (106).

Wacha (3-7) allowed two hits until rookie Willson Contreras' one-out, two-run homer in the seventh ended his day as he snapped a seven-game skid.

ASTROS 3, ANGELS 2

HOUSTON - Jose Altuve homered and Marwin Gonzalez's tiebreaking RBI triple in the eighth inning helped Houston to its fifth straight win

George Springer singled with one out before Gonzalez hit a towering fly ball just to the right of straightaway centre field off Matt Shoemaker (3-8).

Shane Robinson sprinted up Tal's Hill to grab it, but it sailed just out of his reach before Robinson crashed into the padded wall, allowing Springer to score and make it 2-1.

Houston added an insurance run on a groundout by Carlos Correa in the eighth.

Will Harris allowed a run-scoring single by Kole Calhoun with one out in the ninth, but Yunel Escobar was out at second on the play. Harris then retired Mike Trout for his sixth save. Luke Gregerson (2-1) struck out one in a scoreless eighth for the win.

WHITE SOX 8, RED SOX 6

BOSTON - Brett Lawrie hit a go-ahead homer in the eighth inning after Melky Cabrera had a tying, two-run shot to lift Chicago.

The White Sox have won the first three games of a four-game series.

Dan Jennings (3-1) got four outs for the win. Zach Duke got the final three for his first save and third of his career.

Cabrera tied it with a drive into Chicago's bullpen off Koji Uehara (2-3).

GIANTS 7, PIRATES 6

PITTSBURGH - Buster Posey threw out John Jaso attempting to steal second base to end the game after Joe Panik's two-run double capped a three-run sixth inning that helped San Francisco rally from an early five-run deficit.

NL West-leading San Francisco has won 11 of its last 13 and scored 73 runs in that stretch.

The Giants' Jeff Samardzija matched the shortest start of his nine-year career with just three innings.

Rookie Derek Law (3-1), who was born and raised in Pittsburgh, pitched two innings after Samardzija for the win. Santiago Casilla worked around a leadoff single in the ninth for his 15th save.

Jared Hughes (0-1) gave up all three sixth-inning runs.

ORIOLES 7, PADRES 2

BALTIMORE - Ubaldo Jimenez interrupted his exile to the bullpen with a sharp performance in a starting role, and Baltimore got its 1,000th win at Camden Yards.

Mark Trumbo and Ryan Flaherty homered for the first-place Orioles, who also got two RBIs from Matt Wieters.

Jimenez (4-7) gave up two runs and four hits in six innings, walking three and striking out seven. The right-hander lost his spot in the rotation earlier this month after a series of poor outings, including a clunker in Toronto on June 12 in which he yielded five runs and got only one out.

But Jimenez received this spot start after Mike Wright was demoted to the minors, and he overcame a shaky first inning to show some of the prowess the Orioles expected when they signed him to a four-year, $50 million contract in 2014.

Erik Johnson (0-3) allowed six runs and nine hits, including two homers, in four innings.

INDIANS 6, RAYS 1

CLEVELAND - Trevor Bauer threw a three-hitter for his second career complete game, Jason Kipnis hit a two-run homer and Cleveland got its sixth straight win.

Bauer (5-2) struck out 10, walked one and allowed only one runner past second base. It was the second straight three-hitter for the Indians, following Corey Kluber's in a 6-0 win over the Rays on Tuesday.

Kipnis' homer highlighted a three-run first inning off Chris Archer (4-10). Carlos Santana drove in two runs while Jose Ramirez and Francisco Lindor also had RBIs.

Cleveland leads the AL Central and has won 11 straight at Progressive Field. The Indians are also 11 games over .500 (41-30).

RANGERS 6, REDS 4

ARLINGTON, Texas - Cole Hamels struck out eight in six solid innings, Prince Fielder had a two-run single and Texas got a split in the two-game interleague series.

The Rangers, who have the American League's best record at 47-26, went ahead to stay with four runs in the fourth off Dan Straily (4-4).

Hamels (8-1) scattered five hits, walked two and allowed only one run.

BLUE JAYS 5, DIAMONDBACKS 2

TORONTO - Russell Martin hit a three-run homer, Edwin Encarnacion and Troy Tulowitzki added solo shots and Toronto snapped Arizona's five-game winning streak.

J.A. Happ (9-3) won his third straight start and maintained his streak of never having given up more than two earned runs in his fifth start against the Diamondbacks, who left nine runners on base. Roberto Osuna picked up his 14th save.

Robbie Ray (4-6) lasted 5 1/3 innings, giving up four hits and four earned runs with eight strikeouts.

TIGERS 5, MARINERS 1

DETROIT - Steven Moya homered twice, and Detroit withstood a shaky fifth inning from right-hander Michael Fulmer.

Miguel Cabrera also went deep for Detroit, and reliever Kyle Ryan (2-2) helped the Tigers stay comfortably ahead after Fulmer went through some control problems in the fifth.

Hisashi Iwakuma (6-6) allowed five runs and 11 hits in 4 2/3 innings. The Mariners have lost five straight.

BREWERS 4, ATHLETICS 2

OAKLAND, Calif. - Scooter Gennett and Kirk Nieuwenhuis homered to back Junior Guerra's first victory in more than a month, and Milwaukee earned a split of its quick two-game interleague series against Oakland.

Guerra (4-1) struck out eight over seven innings while facing the A's for the first time in his career. Tyler Thornburg finished for his second save.

A's starter Daniel Mengden (0-3) struck out nine in his third career start.

MARLINS 3, BRAVES 0

MIAMI - Adam Conley pitched a career-high eight innings and Miami broke Atlanta's six-game winning streak.

Conley (4-4) became the first Marlins starter to pitch eight innings this year. A.J. Ramos gave up a pair of two-out singles in the ninth but earned his 32nd consecutive save, including 23 this year.

John Gant (1-2), making his third career start, gave up three runs in 5 2/3 innings.

TWINS 6, PHILLIES 5

MINNEAPOLIS - Max Kepler made up for a costly error with a tying single in the fifth inning and the go-ahead sacrifice fly in the seventh as Minnesota handed Philadelphia its ninth straight loss.

Kepler's fly ball to left off reliever David Hernandez (1-2) in the seventh drove in Trevor Plouffe with the tiebreaking run.

Taylor Rodgers (3-0) worked a scoreless seventh and Fernando Abad got the last four outs for his first save.