Martinez’s one-out shot over the centre-field wall bailed out the Tigers, who had been unable to get a clutch hit for eight innings. But in the ninth, Torii Hunter drew a leadoff walk from Allen (5-4), Miguel Cabrera singled, and after Victor Martinez flied out, J.D. Martinez connected for his 19th homer.

Detroit’s comeback kept the Tigers on the heels of first-place Kansas City in the AL Central.

Carlos Santana hit a two-run homer for Cleveland, which has dropped the first two in this critical four-game series.

MARINERS 6, ATHLETICS 5

OAKLAND, Calif. (AP) — James Paxton pitched shutout ball into the eighth inning and Seattle held off a late rally by Oakland, handing the Athletics their fifth loss in six games.

Paxton (5-1) gave up three hits through the seventh. Ahead 6-0, he got chased in Oakland’s three-run eighth, and the A’s nearly got even in a harried ninth.

Seattle closer Fernando Rodney took over with a 6-3 lead and retired the first two batters. He then gave up consecutive doubles to Derek Norris and pinch-hitters Brandon Moss and Sam Fuld before retiring Josh Reddick on a grounder for his 40th save.

The A’s remained 4 1 / 2games back of the first-place Angels, who lost at Houston. Seattle is third in the AL wild-card standings.

Oakland’s Sonny Gray (13-8) gave up six runs in five innings.

CARDINALS 6, PIRATES 4

ST. LOUIS (AP) — Adam Wainwright earned his 16th win and matched his career best with three RBIs, carrying the Cardinals to the victory.

The bottom of the order was the difference in the fourth win in a row for the NL Central leaders. Eighth-place hitter Peter Bourjos singled twice and drove in a run, and seventh-place hitter Daniel Descalso walked twice and scored twice.

Wainwright (16-9) prevailed despite allowing three home runs to match his career worst. He left after Starling Marte’s two-run shot shaved the lead to 5-4 with none out in the seventh.

Pat Neshek pitched the ninth for his fifth save.

Russell Martin and Jordy Mercer also homered for the Pirates, who have lost three in a row. Jeff Locke (6-4) got the loss.

ROYALS 2, RANGERS 1

KANSAS CITY, Mo. (AP) — Salvador Perez hit a scorching liner off the glove of third baseman Adrian Beltre for a single, allowing Jarrod Dyson to score the go-ahead run in the eighth inning for Kansas City.

Jason Frasor (4-1) left runners on the corners in the eighth against his former team, and Aaron Crow worked around a two-out single in the ninth for his third save of the season.

The Rangers’ Derek Holland and counterpart Jeremy Guthrie pitched to a stalemate through seven innings before the Royals broke through against Michael Kirkman (0-1) in the eighth.

The Royals’ Nori Aoki and the Rangers’ Daniel Robertson drove in the game’s other runs.

RED SOX 9, YANKEES 4

NEW YORK (AP) — Xander Bogaerts homered among his four hits and fellow rookie Mookie Betts also went deep during a big night at the plate, powering Boston to the win.

Daniel Nava hit a three-run shot to back Joe Kelly’s first win with Boston. Betts had three hits and slumping Mike Napoli hit two sacrifice flies for the last-place Red Sox, who have won eight of their last 11 road games.

A furious Brett Gardner got ejected on a frustrating — and sometimes embarrassing — night for the Yankees, who began the day four games out of a playoff spot before losing their fifth in seven games following a five-game winning streak.

Rookie right-hander Shane Greene (4-2) was hit hard and chased in the third inning.

Jonathan Schoop homered for the Orioles, who extended their lead in the AL East to a season-high 9 1 / 2games. Baltimore endured two rain delays totalling more two hours and withstood an eighth-inning grand slam by Jay Bruce to notch its seventh win in nine games.

Norris (12-8) allowed four hits. Zach Britton worked the ninth for his 32nd save.

Cincinnati’s Mat Latos (5-4) yielded five runs and a season-high 10 hits over five innings in his first loss since July 27.

ASTROS 8, ANGELS 3

HOUSTON (AP) — Jose Altuve had four hits for the second straight game and Brad Peacock threw 6 1-3 solid innings, leading Houston to the win.

Altuve became the first Astro to accomplish that feat since Lance Berkman in May 2008. Altuve’s homer in the third extended Houston’s lead to 4-0 and was his sixth straight plate appearance with a hit.

Peacock (4-8) gave up three runs and four hits while earning his first win since July 8 at Texas. Houston has won four of its last five.

Gordon Beckham had three hits for the AL West-leading Angels, who had won six in a row. C.J Wilson (10-9) was tagged for five runs in 3 1-3 innings.

GIANTS 12, ROCKIES 7

DENVER (AP) — Buster Posey homered, doubled twice and drove in four runs, rallying San Francisco to the road win.

Posey’s solo homer in the sixth keyed a three-run burst as the Giants erased a 7-1 deficit to remain on the heels of the Dodgers in the NL West. He hit a two-run double in a six-run seventh.

George Kontos (4-0) kept the Giants in striking distance with 1 2-3 scoreless innings until the bats could heat up.

Josh Rutledge had a two-run triple in the third and DJ LeMahieu followed a two-run homer for the Rockies, who have the worst record in the National League. Reliever Matt Belisle (4-7) got the loss.

PHILLIES 4, BRAVES 0

ATLANTA (AP) — Kyle Kendrick allowed three hits in seven innings, Carlos Ruiz homered and drove in two runs, and the Phillies shut out the struggling Braves.

One day after Cole Hamels and three relievers threw the first combined no-hitter in Phillies history, Kendrick (8-11) and relievers Ken Giles and Antonio Bastardo were dominant in the three-hit shutout.

The Braves, who began the night 1 1 / 2games behind the NL wild-card leaders, have lost three of four. With two straight shutout losses, they haven’t scored in 24 consecutive innings.

Jason Heyward had two doubles. Atlanta’s only other hit was a third-inning single by Andrelton Simmons.

MIAMI (AP) — David Wright broke out of his offensive woes with three hits and three RBIs, leading the Mets to the victory.

Juan Lagares reached base five times, including a career-high four hits, stole two bases, scored three runs, and drove in two for the Mets, who pounded out 16 hits.

Marlins slugger Giancarlo Stanton hit his 35th home run and second in two games against the Mets. He drove in two runs to give him 101 RBIs, becoming the first Marlins player to drive in 100 runs since Dan Uggla had 105 RBIs in 2010.

Christian Yelich had three of the Marlins’ 11 hits. Brad Penny (1-1) took the loss.

Jonathon Niese (8-10) pitched six innings for New York, and Jenrry Mejia worked the ninth for his 22nd save.

WHITE SOX 6, TWINS 3, 10 INNINGS

MINNEAPOLIS (AP) — Tyler Flowers’ first career multihomer game lifted the White Sox to the win.

Dayan Viciedo hit a tiebreaking solo shot in the 10th against Lester Oliveros (0-1). Flowers added his second two-run shot of the night later in the inning as the White Sox won for just the fourth time in their last 14 games.

After rookie Kennys Vargas gave Minnesota a 2-0 lead in the first with a 423-foot homer, Flowers tied it in the second with his 11th homer.

An errant pickoff attempt allowed pinch-runner Aaron Hicks to advance to third base in the ninth, but Chicago’s Daniel Webb (6-4) recovered and got Kurt Suzuki to fly to right.

Jake Petricka pitched the 10th for his 11th save.

PADRES 2, DIAMONDBACKS 1

SAN DIEGO (AP) — Cory Spangenberg’s first big league home run came on the first pitch he saw as a pinch hitter with one out in the ninth inning and gave San Diego the victory.

Spangenberg, hitting for Cameron Maybin, connected against Brad Ziegler (5-3), sending a drive to the home run porch down the right-field line at Petco Park.

Spangenberg made his big league debut on Monday, hitting a two-run single and making two nice plays at third base.