NEW YORK: Kirk Nieuwenhuis homered three times to help the New York Mets beat the Arizona Diamondbacks 5-3 on Sunday and complete a three-game sweep.

Nieuwenhuis homered twice off Diamondbacks starter Rubby De La Rosa (6-5), in the second and third innings and once off reliever Randall Delgado in the fifth. His homer off Delgado rang off the right field foul ball and drew a curtain call from the cheering crowd of 28,259.

The Mets centerfielder’s effort backed Jonathon Niese, who was starting in place of the injured Steven Matz. Niese (5-8) allowed three runs and five hits in 6 2-3 innings.

Nieuwenhuis’ effort marked the first time any Met had ever homered three times in a home game. Nieuwenhuis is the 10th player in Mets history with a three-homer game and the first since Ike Davis accomplished the feat on July 28, 2012 at Arizona.

All-Star Sonny Gray allowed just two hits in a shutout and allowed only three base runners, leading the Oakland Athletics to a 2-0 win over the Cleveland Indians.

Gray, who lowered his AL-best ERA to 2.04, walked one and struck out six. Only three outs were recorded by outfielders in his third career shutout.

Gray (10-3) retired the first 10 hitters before Francisco Lindor’s one-out single in the fourth. The right-hander walked David Murphy to lead off the fifth and retired 11 in a row until Giovanny Urshela’s two-out single in the eighth.

In Pittsburgh, Gregory Polanco capped another late rally, driving in Kang Jung-ho with two outs in the 10th inning to lift the Pittsburgh Pirates past the St. Louis Cardinals 6-5.

The Cardinals took a 5-3 lead in the top of the 10th on a two-run double by Randal Grichuk off Arquimedes Caminero (1-1). Pittsburgh, which won in 14 innings on a homer by Andrew McCutchen on Saturday, did it again 24 hours later against St. Louis All-Star closer Trevor Rosenthal (1-2).

Tampa Bay Pitcher Matt Moore got his first win since elbow surgery with help from the Tampa Bay bullpen as the Rays completed a three-game sweep by beating the Houston Astros 4-3.

The Miami Marlins downed the Cincinnati Reds 8-1 after Dan Haren repeatedly pitched out of jams and allowed only one run in six innings.

The Reds stranded seven runners in scoring position against Haren, and threatened in all but one inning he worked. They went 1 for 11 with runners in scoring position against the right-hander.

The Reds’ defense was no better, committing a pair of errors that resulted in three unearned runs.

Justin Bour had three hits and three RBIs for the Marlins.

New York’s Alex Rodriguez doubled to break a sixth-inning deadlock, move into the top 25 on baseball’s career hits list and helped the Yankees beat the Boston Red Sox 8-6.

The win gave the Yankees the edge in the three-game series and moved them 6 1/2 games in front of last-place Boston in the bunched-up AL East. New York leads the division by 3 1/2 games heading into the All-Star break.

In Baltimore, Max Scherzer ended his impressive first half with another dominant performance, taking a three-hitter into the ninth inning to lead the Washington Nationals to a 3-2 victory over the Orioles, while Minnesota’s Kyle Gibson won his fourth straight start, throwing seven strong innings, and rookie Miguel Sano hit a two-run homer to lead the Twins to a 7-1 win over the Detroit Tigers.

In other games, Paulo Orlando broke a deadlock with an eighth inning homer and Kendrys Morales hit a three-run homer as the Royals defeated the Blue Jays 11-10, the Chicago Cubs defeated the White Sox 3-1, the San Diego Padres edged the Texas Rangers 2-1 and the San Francisco Giants beat the Philadelphia Phillies 4-2.

In Seattle, Chris Iannetta hit a two-run home run and David Freese added a two-run double as part of a six-run sixth inning as the Los Angeles Angels entered the All-Star break in first place in the American League West with a 10-3 win over the Mariners, the Los Angeles Dodgers sneaked past the Milwaukee Brewers 4-3 and the Colorado Rockies were 11-3 winners over the Atlanta Braves.