Jose Altuve homered with one out in the bottom of the ninth, the last of his four hits, and the Houston Astros beat Boston 5-4 on Thursday night, extending the Red Sox's losing streak to a season-high eight games.

The game was tied at 4-all when Altuve connected off Craig Breslow (0-1) and homered into the seats in left-center. The play was reviewed and confirmed.

Marwin Gonzalez and Colby Rasmus both went deep for the Astros, who lead the majors with 135 home runs.

More from FoxSports

Josh Fields pitched a scoreless ninth for the win (3-1).

Boston's David Ortiz cut the lead to 4-3 with a solo homer off Will Harris with no outs in the eighth. Mike Napoli's RBI double off closer Luke Gregerson later in the inning tied it.

Houston trailed by one run in the seventh before a pinch-hit homer by Rasmus tied it 2-2 with one out. Altuve singled and stole second base before scoring on a double by Gonzalez.

Gonzalez was thrown out trying to stretch it to a triple before rookie Carlos Correa doubled and scored on a single by Evan Gattis to push the lead to 4-2.

Napoli hit a solo homer in the second for Boston (42-54), which dropped a season-high 12 games under .500.

Boston starter Wade Miley yielded four hits and one run in six innings. He was replaced by Alexi Ogando and he gave up the full-count homer by Rasmus before being chased on Altuve's single.

Houston rookie Lance McCullers allowed six hits and two runs in five innings.

Mookie Betts doubled and scored on the double by Ortiz to put Boston up 1-0 in the first.

Houston tied it in the bottom of the inning on the homer by Gonzalez, which landed in the Crawford Boxes in left field. Gattis singled with two outs, but was caught trying to steal second to end the inning.

Napoli's two-out, two-strike homer, which bounced off the wall above the Crawford Boxes, made it 2-1 in the second inning.

Ryan Hanigan singled after that before Betts drew a walk. The Red Sox missed a chance to build on their lead when Hanigan was thrown out at the plate when he tried to score on a single by Brock Holt.

Correa, who extended his hitting streak to a career-long eight games, robbed Xander Bogaerts of a hit when he dived to make the stop on his grounder and made a perfect throw to first base for the first out of the third inning.

TRAINER'S ROOM

Astros: INF Jed Lowrie, who has been out since April 27 because of a torn ligament in his thumb, felt good on Thursday after playing the first game of a rehabilitation assignment with Double-A Corpus Christi the night before. He's expected to play four more games before he is activated.

UP NEXT

Red Sox: RHP Rick Porcello opposes Detroit RHP Justin Verlander when the Red Sox open a three game series against the Tigers. Manager John Farrell announced Thursday that Steven Wright will be recalled from Triple-A to start on Saturday and Eduardo Rodriguez will be pushed back to Sunday.

Astros: LHP Scott Kazmir will make his Astros debut against Kansas City's Jeremy Guthrie in the opener of a three-game series on Friday. Kazmir was traded from Oakland on Thursday for two prospects. Scott Feldman, who was scheduled to start that game, will be moved to Saturday.