ARLINGTON (AP) — Nomar Mazara and Joey Gallo hit impressive home runs in the same inning, and the Texas Rangers avoided a series sweep with a 7-4 win over the Seattle Mariners on Sunday.

Mazara pulled a shot into the right-center seats beyond the Rangers bullpen in the fourth, a drive that would have been 441 feet unimpeded. Adrian Beltre walked. Gallo’s opposite-field popup that carried into the Seattle bullpen for his seventh homer and a 4-0 lead over Erasmo Ramirez (0-1), who was making his season debut.

Martin Perez (2-2) gave up seven hits, walked a batter and hit another one in six innings before leaving with a 5-2 lead. The Texas lefty, who has given up 36 hits and eight walks in 18 1/3 innings this season, lowered his ERA from 13.14 to 9.82.

Keone Kela worked a scoreless ninth for his third save. He allowed consecutive hits starting the inning, but the game ended when shortstop Jurickson Profar made a tough catch of a popup in shallow left field.

Mitch Haniger homered in all three games of the series. His two-run shot in the seventh off Matt Bush got the Mariners to 5-4 before they loaded the bases against the second reliever in the inning. Jake Diekman had a throwing error and a walk, then struck out David Freitas and pinch-hitter Mike Zunino to end the threat.

That came an inning after Rangers center fielder Delino DeShields, activated from the disabled list for his first game since March 30, had a homer-robbing catch of a Frietas drive. DeShields had surgery three weeks ago to remove a broken hamate bone from his left hand.

Ramirez, who didn’t appear in a spring training game and started the season on the disabled list because of a strained right lat, allowed five runs and five hits in 4 2/3 innings.

To make room on the 25-man roster for Ramirez, the Mariners optioned Guillermo Heredia, one of their five outfielders, to Triple-A Tacoma. Ichiro Suzuki, the 44-year-old outfielder who stayed, had two infield singles and walked twice.

(© Copyright 2018 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)