ARLINGTON (AP) — Elvis Andrus hit two of the four Texas home runs and the Rangers held on beat the Los Angeles Angels 7-6 Sunday in the rubber game of a series with wild-card implications for both teams.

The Rangers (68-68) went ahead to stay when Robinson Chirinos and Delino DeShields hit back-to-back homers in the fourth inning. No. 9 hitter Chirinos’ two-run homer tied the game at 4 before DeShields went deep.

With four weeks left in the regular season, Texas was within three games of Minnesota for the AL’s second wild-card spot. The Angels (70-67) are 1 1/2 games back of that playoff spot.

Martin Perez (11-10) threw a career-high 117 pitches over six innings to win his sixth straight start.

Tony Barnette earned his second save in six chances after coming on with two on and no outs in the ninth. Barnette gave a two-run double to Andrelton Simmons after getting Albert Pujols on a popout with the bases loaded, and before a walk forced in another run.

Andrew Heaney (1-1) has allowed 11 homers in 19 1-3 innings over four games since getting called up last month.

C.J. Cron put the Angels ahead with a two-run double in the first. His two-run homer with two outs in the ninth inning Saturday night tied the game the Angels won in 10 innings.

Will Middlebrooks had an RBI single in the Texas second, and Andrus led off the third with a tying homer. Andrus hit a two-run shot, his 18th, in the sixth after DeShields walked.

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