NEW YORK -- New fan favourite Wilmer Flores hit a leadoff homer in the 12th inning to give the New York Mets a 2-1 victory over the Washington Nationals on Friday night in the opener of a pivotal series between the top teams in the NL East.

Two nights after endearing himself to Mets rooters when they saw him wiping tears away at shortstop after he thought he'd been traded, Flores received four standing ovations.

Just a few minutes before the 4 p.m. trade deadline, the Mets gave their meagreoffence a major boost by obtaining slugger Yoenis Cespedes from Detroit for two minor league pitchers. Hours later, Flores drove in both Mets runs and made a spectacular defensive play at second base to back Matt Harvey.

The 23-year-old infielder drove a 1-1 pitch from Felipe Rivero (1-1) to left-centre for his 11th home run and first in 147 at-bats since June 12 against Atlanta.

Nationals slugger Bryce Harper was ejected in the 11th after taking a called third strike and screaming right in the face of plate umpire Jerry Meals.

Flores put the Mets ahead in the fourth against Gio Gonzalez with a two-out RBI single off the glove of diving shortstop Ian Desmond.

Yunel Escobar tied it in the eighth with a two-out RBI single on Harvey's final pitch.

Carlos Torres (4-4) was the winner.

BLUE JAYS 7, ROYALS 6, 11 INNINGS

TORONTO -- Josh Donaldson singled home Troy Tulowitzki in the 11th inning and the new-look Toronto rallied to beat Kansas City as Johnny Cueto failed to get a decision in his Royals' debut.

After acquiring Tulowitzki and reliever LaTroy Hawkins from Colorado and starter David Price from Detroit, the Blue Jays obtained right-hander Mark Lowe from Seattle and outfielder Ben Revere from Philadelphia ahead of Friday's trade deadline.

Tulowitzki played a key role in the win. With the score 6-all in the 11th, he singled to centre and advanced on a balk by Franklin Morales (3-1).

Donaldson singled to left-centre, giving Toronto its third straight win and sending the AL champion Royals to their third defeat in a row. Donaldson, mobbed at first base after his winning hit, went 3 for 4 with a walk and two RBIs. Liam Hendriks (3-0) pitched one inning for the win.

YANKEES 13, WHITE SOX 6

CHICAGO -- Mark Teixeira homered from both sides of the plate for the record 14th time, hitting his 10th grand slam and a two-run homer that led New York past Chicago.

Teixeira had his second straight two-homer game and leads the Yankees with 28 homers and 73 RBIs.

Batting right-handed, Teixeira's slam off Carlos Rodon (4-4) put New York ahead 6-0 in a five-run second. Batting left-handed, he connected against Matt Albers for a 9-2 lead in a five-run fourth.

Teixeira, who went 3 for 4 with two walks, had been tied with Cleveland's Nick Swisher at 13 games homering from both sides, according to STATS. It was Teixeira's 41st multihomer game overall.

Alex Rodriguez had two hits, including a double, to reach 1,500 hits with the Yankees and also walked three times while scoring four runs. Carlos Beltran and Brendan Ryan each had three of New York's 18 hits.

Nathan Eovaldi (11-2) was the winner.

CARDINALS 7, ROCKIES 0

ST. LOUIS -- Matt Carpenter homered for the third time in two games, Michael Wacha pitched seven crisp innings and St. Louis beat Colorado.

Carpenter, who hit two homers and drove in four runs in a 9-8 win over Colorado on Thursday, also had a double and reached three times.

Carpenter slammed a first-inning leadoff home run off right-hander Kyle Kendrick (4-12), who left after one inning with shoulder inflammation. It was Carpenter's seventh career leadoff homer and third this season. Kendrick has surrendered a major league-high 26 home runs.

Jhonny Peralta added a two-run homer for the Cardinals (66-37), who have won eight of 11 to move a season-high 29 games over .500 for the third time this season. Stephen Piscotty had a two-run double to help St. Louis run its major league-best home record to 39-15.

The six-hitter for Wacha (12-4) and two relievers came after St. Louis bolstered its bullpen by acquiring Jonathan Broxton before the non-waiver trade deadline Friday.

RANGERS 6, GIANTS 3

ARLINGTON, Texas -- Elvis Andrus and Adrian Beltre homered and Texas beat San Francisco in the Giants' first visit since winning the 2010 World Series in Texas.

Madison Bumgarner (11-6) gave up both homers and helped ignite a benches-clearing fracas when he shouted something toward the Rangers bench at the end of the fourth inning. There were no ejections, punches thrown or contact made between players, who were kept separated by the umpires.

Andrus hit a two-run homer in the second to put the Rangers up 6-2. He doubled in the first, scoring then on Beltre's homer lined over the 14-foot wall in left field.

Nick Martinez (6-6) won for the first time in seven starts, allowing two runs with four strikeouts in 6 1-3 innings.

DODGERS 5, ANGELS 3

LOS ANGELES -- Zack Greinke won his fifth straight decision, Howie Kendrick homered in his first game against his former team, and the Dodgers beat the Angels in the opening game of the Freeway Series.

Rookie Alex Guerrero hit a tiebreaking two-run homer in the fourth inning in support of Greinke (10-2), who allowed two runs and five hits in eight innings. The 2009 AL Cy Young Award winner, who leads the majors with a 1.41 ERA, had his consecutive scoreless inning streak snapped at a career-best 45 2-3 innings last Sunday in a no-decision against the Mets at New York.

Kenley Jansen got his 18th save in 19 chances despite giving up Mike Trout's major league-leading 32nd homer leading off the ninth. The Dodgers' victory, coupled with San Francisco's loss at Texas, increased their NL West lead over the Giants to 1 1/2 games.

Hector Santiago (7-5) was the loser.

ORIOLES 8, TIGERS 7

BALTIMORE -- Adam Jones and Manny Machado homered and Baltimore overcame a six-run deficit to beat trade-ravaged Detroit.

Down 6-0 in the fourth inning, the Orioles teed off against the pitching-poor Tigers and went ahead 7-6 in the sixth when Machado hit a two-run drive off rookie Jose Valdez (0-1), making his big league debut.

One night earlier, Detroit blew most of a 9-2 advantage in a one-run victory.

It was the sixth win in seven games for the Orioles, who earlier in the day bolstered their roster for a playoff run by obtaining outfielder Gerardo Parra from Milwaukee before the non-waiver deadline.

Mychal Givens (1-0) earned his first big league win with 1 2-3 innings of one-hit relief, and Zach Britton got three outs for his 27th save.

PIRATES 5, REDS 4

CINCINNATI -- Andrew McCutchen hit another homer at Great American Ball Park, and Pittsburgh's rebuilt bullpen was shaky but delivered in a victory over Cincinnati.

The Pirates got their first win of the season in Cincinnati -- they'd been 0-4 -- and finished July with a 17-9 record, the best in the National League.

McCutchen connected off Michael Lorenzen (3-6), and Jung Ho Kang had three doubles and drove in a run to support Jeff Locke (6-6).

Former Tigers closer Joakim Soria arrived a few hours before the game and slipped into his new role as setup man. He loaded the bases with two outs in the seventh -- a pair of walk got him in trouble -- but snagged Brayan Pena's liner over his head to end the threat.

DIAMONDBACKS 6, ASTROS 4, 10 INNINGS

HOUSTON -- Wellington Castillo and Jake Lamb homered to open the 10th inning and Arizona beat the Houston for its season-high sixth straight victory.

Castillo had three hits and finished a triple shy of the cycle. He hit the first pitch of the inning from Pat Neshek (3-2) just inside the left-field foul pole for his 11th home run of the year.

Lamb followed with a shot to right.

Neshek had not allowed two home runs in an inning this season and had not allowed a home run since June 10 at the White Sox.

Daniel Hudson (3-3) pitched two scoreless innings to pick up the win, and Brad Ziegler got the last three outs for his 18th save.

RED SOX 7, RAYS 5

BOSTON -- Boston held onto Mike Napoli at the trading deadline, and he responded a few hours later with a two-run homer off the top of the Green Monster against Tampa Bay.

The Red Sox had already blown two leads when David Ortiz drew a two-out walk in the seventh inning and Napoli turned a one-run deficit into a 6-5 lead with a drive that landed on the ledge atop the 37-foot-high wall. Another subject of trade talks, Alejandro de Aza, had two hits for Boston. Blake Swihart also had a pair of hits, doubling with one out in the eighth and scoring on a wild pitch to make it 7-5.

Junichi Tazawa (2-3) earned the win despite allowing John Jaso's two-run double that gave Tampa Bay a 5-4 lead in the seventh. Koji Uehara pitched the ninth for his 23rd save.

Jake McGee (0-1) pitched one inning, giving up two runs on one hit and a walk.

PADRES 8, MARLINS 3, 11 INNINGS

MIAMI -- A.J. Ramos forced home the tiebreaking run with a bases-loaded, four-pitch walk in the 11th inning, Jedd Gyorko added a two-run single and San Diego beat Miami.

After the Padres decided not to deal any of their major players at the trade deadline, San Diego won for the sixth time in seven games and the 11th time in its last 15.

With the score 3-3, Will Venable singled with a soft liner against Ramos (0-3) leading off the 11th and advanced to third when catcher J.T. Realmuto's throw went into centre field for an error.

Ramos struck out Yangervis Solarte, then walked three in a row, including Yonder Alonso with the bases loaded. Andre Rienzo walked Derek Norris with a full count, forcing in another run, and Venable singled for a 7-3 lead. Brandon Maurer (7-3) was the winner.

PHILLIES 9, BRAVES 3

PHILADELPHIA -- Domonic Brown hit a two-run homer and Ryan Howard drove in four runs, helping David Buchanan and Philadelphia beat Atlanta.

The resurgent and rebuilding Phillies won for the 11th time in 13 games since the All-Star break on a day they finalized a trade that sent 2008 World Series MVP Cole Hamels to Texas. Despite their recent turnaround, the Phillies (40-64) still have the worst record in the majors.

Buchanan (2-5) allowed three runs and eight hits in 7 1-3 innings after being called up from Triple-A Lehigh Valley to replace Hamels in the rotation.

Braves starter Williams Perez (4-1) gave up nine runs and nine hits in 4 1-3 innings.

Freddie Freeman hit his 100th career homer for Atlanta. The Braves have lost five in a row.

MARINERS 6, TWINS 1

MINNEAPOLIS -- Taijuan Walker pitched a one-hitter for his first career complete game in 29 major league starts, and Nelson Cruz and Jesus Montero homered to lift Seattle past Minnesota.

Walker (8-7), who gave up a home run to rookie Miguel Sano, tied a career high with 11 strikeouts to help Seattle end a four-game losing streak.

Cruz had four hits, including his 27th home run, and Montero added two hits and two RBIs after being recalled from Triple-A following a series of moves by the Mariners prior to Friday's trade deadline.

Tommy Milone (5-3) gave up four runs and 11 hits for Minnesota. The Twins have lost four of five.

INDIANS 2, ATHLETICS 1

OAKLAND, Calif. -- Danny Salazar pitched eight innings of one-hit ball, Michael Bourn doubled in the tiebreaking run in the eighth, and Cleveland beat Oakland for its third straight victory.

Lonnie Chisenhall had three hits, stole a base and scored the go-ahead run for the Indians, They lost eight of 11 before the streak.

Salazar (9-6) walked one and struck out four to end a personal two-game slide. He has a 1.53 ERA over his last four starts, spanning 29 1-3 innings.

Cody Allen got the last three outs for his 21st save. Edward Mujica (2-3) took the loss.

CUBS 4, BREWERS 1

MILWAUKEE -- Jason Hammel beat Milwaukee for the seventh consecutive decision with his first win in almost two months and Anthony Rizzo homered to lead Chicago.

Hammel (6-5) improved to 7-0 in nine starts against Milwaukee and picked up his first victory since June 6. He allowed a run on six hits over 5 2-3 innings to beat the Brewers for the second time this season. His only mistake was a pitch Ryan Braun hit in the first for his 19th home run.

Hector Rondon pitched the ninth for his 15th save.

Milwaukee starter Taylor Jungmann (5-3) was the loser.