ARLINGTON, Texas - Jon Singleton's debut against the Texas Rangers turned out nicely for him and the Houston Astros.

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

The 22-year-old rookie ended an 0-for-10 slump that had dropped his average to .168 with his second three-hit game of the season and helped boost the Astros to 4-3 this season against their Texas rival.

Houston was 2-17 against the Rangers in its first season in the AL West last year.

"When you look at the work which he's putting in day in and day out, it's good to see him get some results on the field," manager Bo Porter said. "He has a chance to be a really special middle-of-the-lineup bat for a long time in the big leagues."

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-centre for a three-run shot and a 9-2 lead in the fourth.

"It's a work in progress every day," Singleton said. "Today I tried not to think too much. I was seeing the ball. That's about it."

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.

It was the second career start for Mikolas, who was strong for five innings before fading in the sixth last week in Baltimore. He struck out five and didn't walk a batter.

"There were strikes, but you have to throw quality strikes," Rangers manager Ron Washington said. "They just found a way to put the ball in play and find the grass out there. And then Gonzalez was the big blow."

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, playoff contenders the past four seasons, lost for the 16th time in 19 games. Texas started the day 17 games behind Oakland and finished it just two ahead of last-place Houston, which has lost at least 100 games three straight years.

"Our goal is to play better baseball than we did the year before," Porter said. "We are getting better. We still have a ways to go. Regardless of what team they put in front of us, it's just beat that team that night."

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.