ARLINGTON, Texas -

Jon Singleton homered among three hits and drove in four runs, Marwin Gonzalez had a bases-loaded triple and the Houston Astros snapped a seven-game skid with a 12-7 victory over the Texas Rangers on Monday night.

Gonzalez's triple followed five consecutive singles in a six-run second inning, and Singleton's towering flyball landed two rows above the Texas bullpen in right-center for a three-run shot and a 9-2 lead in the fourth.

Jarred Cosart (9-6) won for the first time in 12 career starts against AL West opponents despite allowing nine hits and six runs — five earned — in five innings.

Every Houston batter had at least one hit after George Springer's infield single with one out in the fourth. Singleton followed with his sixth homer to knock out Texas starter Miles Mikolas (0-1), who gave up 12 hits and nine runs in 3 1-3 innings.

Adrian Beltre extended his hitting streak to 10 games with an RBI double in the third inning and a solo homer in the fifth that pulled the Rangers to 9-6. Beltre's team-leading 12th home run came an inning after Elvis Andrus' three-run double down the left field line.

Houston relievers Josh Fields and Tony Sipp kept the Rangers from getting any closer, combining to strike out seven in a row starting in the sixth, when Texas trailed 10-6. The streak included Jake Smolinski in his major league debut for Texas in the seventh.

The Rangers lost for the 16th time in 19 games since they were 35-35 after winning a series opener in Oakland to get within seven games of the A's last month. Texas, a playoff contender the past four seasons, started the day 17 games behind Oakland and finished it just two ahead of last-place Houston.

Singleton had the first of the five straight singles and reached base four times, capped by an RBI double in the eighth. Carlos Corporan also had three hits as the Astros finished with a season-high 17.

Alex Presley hit his fifth homer — a solo shot in the sixth — and was one of four Houston players with two hits. He had to come out after the 10th pitch of an at-bat in the eighth inning when he appeared to injure his right side on a swing. Pinch-hitter L.J. Hoes had a sacrifice fly to right on the first pitch he saw.

NOTES: Jose Altuve tied Houston's franchise record for hits before the All-Star break at 123 on an infield single in the fourth. The play was originally ruled an out before Porter challenged. The replay clearly showed Altuve was safe, tying Bob Watson's record from 1973. Altuve broke the record with a single in the eighth. ... Rangers RHP Nick Martinez was scratched from Tuesday's start because of a pulled muscle in his rib cage. He's being replaced by RHP Phil Irwin, who made his only big league appearance in a start for Pittsburgh last year.