ARLINGTON, Texas (AP) — Martin Perez and Jake Diekman worked out of bases-loaded jams, and center fielder Delino DeShields had a homer-robbing catch in his first game back in the lineup for the Texas Rangers.

With that pitching and defense, and big homers by Nomar Mazara and Joey Gallo in the same inning, the Rangers beat the Seattle Mariners 7-4 on Sunday to avoid a series sweep.

"The look in his eyes, we talk about body language," manager Jeff Banister said of Perez. "He still was in control."

The Mariners loaded the bases with on two singles and a hit batter in the second inning before Perez (2-2) retired the next three batters. Texas was up 4-0 after Mazara and Gallo homered in a three-batter span before Perez gave up two runs in three batters without an out in the fifth before another strong finish to the inning.

DeShields, off the disabled list for his first game since March 30, had a homer-robbing catch of a drive by David Freitas in the sixth.

"Prevent runs from touching home plate, that's my job. I take a lot of responsibility in that," said DeShields, who three weeks ago had surgery to remove a broken hamate bone from his left hand. "Martin was pitching his tail off."

Perez 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 four starts this season, lowered his ERA from 13.14 to 9.82.

Mitch Haniger homered in all three games of the series for Seattle. His two-run shot in the seventh off Matt Bush got the Mariners to 5-4 before they loaded the bases. Diekman had a throwing error and a walk before striking out Freitas and pinch-hitter Mike Zunino to end the threat.

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.

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 then walked before Gallo's opposite-field fly that carried into the Seattle bullpen for his seventh homer and a 4-0 lead over Erasmo Ramirez.

It was the season debut for Ramirez (0-1) after being on the disabled list because of a strained right lat.

"I can say the only good thing is just not being sore," said Ramirez, who allowed five runs and five hits in 4 2-3 innings. "I just wasn't executing pitches. I was behind in the count a lot of times."

ICHIRO STAYS

To make room on the 25-man roster for Ramirez, Seattle optioned Guillermo Heredia, one of its five outfielders, to Triple-A Tacoma. Ichiro Suzuki, the 44-year-old outfielder who stayed, had two infield singles and his first two walks this season. He is hitting .250 in his 12 games, and all nine hits are singles. His 3,089 career hits in the majors are the most for an active player. He had 1,278 hits in Japan before that.

BELTRE EXTRAS

Beltre is next behind Ichiro on the active list with 3,072 hits. Beltre had two doubles Sunday, giving him 1,120 extra base hits to move past George Brett for 17th on that career list.

HOT HANIGER

Haniger also had an RBI double and is hitting .314 with seven homers and 22 RBIs. It is the first time he has homered in three straight games. His eight multi-RBI games are a league high.

"He's making adjustments a little bit quicker," manager Scott Servais said. "The league is certainly pitching him more carefully now that they have a little track record on him. But (Haniger) has been outstanding."

TRAINER'S ROOM

Mariners: CF Dee Gordon, the MLB stolen base leader, was out of the starting lineup on his 30th birthday to rest a sore foot. He pinch hit in the ninth, and had the game-ending popout.

Rangers: Carlos Tocci, who had started eight games in CF, was placed on the 10-day DL with a bruised left hip. Tocci banged against the wall in Tampa Bay trying to make a catch last Monday. ... RHP Doug Fister (right hip strain) threw 40 pitches in a bullpen session and is on track to come off the DL to start Wednesday against Oakland.

UP NEXT

Mariners: Seattle plays the fourth game of its 10-game trip. Mike Leake (2-1) starts the series opener at the Chicago White Sox.

Rangers: Matt Moore (1-3), the lefty who has allowed only three earned runs over 12 innings his last two games, starts the opener of a three-game home series against Oakland.

More From 1460 ESPN