Arlington, Texas: Josh Hamilton hit a two-run homer and Martin Perez allowed only two hits to earn his first win in a comeback from elbow surgery as the Texas Rangers edged the San Francisco Giants 2-1 on Sunday.

Perez (1-2) threw 8 1/3 innings, leaving after allowing a one-out, ninth-inning double to Angel Pagan. Sam Dyson earned his first career save, getting a game-ending double play after allowing a bases-loaded, RBI single to Buster Posey.

In Perez’s previous start last Monday, he failed to get through the second inning against the New York Yankees and allowed eight earned runs in a 21-5 loss.

Hamilton homered into the right-field corner off Mike Leake (9-6), who made his first start with San Francisco. Before that, Texas had put eight runners on without scoring.

New York’s Curtis Granderson, Daniel Murphy and streaking Lucas Duda homered in a span of five pitches to power the Mets past the Washington Nationals 5-2 for a three-game sweep.

Noah Syndergaard (6-5) struck out nine over eight innings as New York pulled within percentage points of first-place Washington in the NL East. Tyler Clippard got the last three outs for his first save with the Mets.

In St. Louis, Brandon Moss had his first big hit with the Cardinals in the ninth inning and Randal Grichuk had a two-run homer in a 3-2 victory over the Colorado Rockies.

Moss’ one-out hit to left off reliever Scott Oberg (2-2) drove in Jason Heyward, who doubled with one out.

The New York Yankees pounded the White Sox 12-3 after Jacoby Ellsbury and Mark Teixeira homered against Jeff Samardzija.

Stephen Drew added three hits and four RBIs, helping the AL East-leading Yankees close out a 6-4 road trip — matching a season high. Ellsbury drove in three runs, and Didi Gregorius had two hits and two RBIs.

Cubs closing pitcher Hector Rondon nearly squandered a three-run lead and rookie Kris Bryant got hurt in a 4-3 win that completed a four-game sweep.

Starter Clayton Richard (2-0) and the Cubs’ bullpen held off the Brewers until the ninth, when Rondon allowed the first two runners to reach base with his team leading 4-1. Ryan Braun scored on a ground-out with one out, and Hernan Perez drove in another run with a two-out single.

Mark Canha hit a two-out double in the 10th inning to drive in Sam Fuld and lift the Oakland Athletics past the Cleveland Indians 2-1, while Dodgers slugger Andre Ethier hit his second dramatic home run in three innings, a two-run shot in the 10th to lead Los Angeles to a three-game Freeway Series sweep of the sputtering Angels.