HOUSTON >> Jason Heyward hit a two-run homer early and Jon Singleton had three hits, capped by a tiebreaking RBI single in Houston’s four-run eighth inning, and the Astros got a 6-3 win over the Oakland Athletics on Thursday.

Brent Rooker homered off Ryan Pressly (2-3) with one out in the eighth to tie it at 2.

Yainer Diaz and Kyle Tucker hit consecutive singles with one out in the eighth to chase T.J. McFarland (2-3) and bring on Grant Holman. There were two outs in the inning when Singleton’s single to center field scored Diaz to put the Astros on top.

“He has contributed immensely,” manager Joe Espada said. “Big hits, he gives you a quality at-bat, finds the barrel, the ability to walk. Jon has done a really, really good job.”

Singleton has seen less playing time lately as Espada has tried different guys at first base.

“You just got to go out there and do your job,” Singleton said. “And I’m grateful whenever I get the opportunity for sure.”

Jake Meyers followed with a run-scoring double before the Athletics intentionally walked Heyward to load the bases. Mauricio Dubón singled on a ground ball to left field to score two more, pushing the lead to 6-2.

“When we can stretch it out and get big hits from everyone we find ourselves scoring some runs late in the game,” Espada said.

Tyler Nevin hit a solo homer off Josh Hader with one out in the ninth before the closer retired the next two batters to end it.

Houston’s Framber Valdez allowed five hits and a run with six strikeouts in 6 1/3 innings to help the Astros avoid a three-game sweep and snap a three-game skid.

Oakland starter Mitch Spence permitted seven hits and two runs in seven innings.

“Spence was awesome,” Oakland manager Mark Kotsay said. “He gave us everything he had for seven solid innings against a solid lineup. This kid just continues to impress.”

Singleton hit a ground-rule double with one out in the second before Heyward smacked a line drive into the second row in right field for his first home run as an Astro to make it 2-0.

It was the third hit in 12 games with Houston for Heyward, who signed with the Astros on Aug. 29, after being released by the Dodgers.

Jacob Wilson doubled to open the seventh and moved to third on a ground out by Nevin. The A’s cut the lead to 1 when Wilson scored on a single by Daz Cameron that chased Valdez.