ARLINGTON, Texas (AP) — Adrian Beltre hit his second home run of the game with two outs in the ninth inning, a two-run shot that rallied the Texas Rangers past the Oakland Athletics 7-6 on Monday night for their third straight win.

Beltre, who finished with four hits, had two singles in his first three at-bats before hitting a solo homer in the seventh. His game-winning drive came on the first pitch from Ryan Madson (3-4).

Until then, Texas had trailed since Danny Valencia hit a two-run homer for Oakland with two outs in the first. All 13 runs in the game were scored with two outs.

Texas turned three double plays behind starter Martin Perez, who has induced a major league-best 25 in 21 games.

Valencia also had the first of three run-scoring doubles in a three-run third that gave the A’s a 5-1 lead.

Madson had his sixth blown save in 27 opportunities.

Ian Desmond hit his 19th homer for the Rangers in the first. Nomar Mazara singled with one out in the ninth.

Jake Diekman (2-1) worked a scoreless inning for the win.

Billy Butler had three hits for the A’s.

Jed Lowrie led off the third with a double. Valencia, Khris Davis and Butler followed with run-scoring doubles.

Texas’ Bobby Wilson doubled to drive in a fourth-inning run. The Rangers pulled to 5-4 on a two-run single by Rougned Odor in the fifth.

Josh Reddick singled to drive in an unearned run against Matt Bush in the seventh before Beltre homered in bottom of the inning.

The teams have split the first eight games in the season series.