HOUSTON - The 5-foot-6, 165-pound Jose Altuve certainly isn't known for his power.

But on Thursday night, when it mattered most, he was able to propel the ball just far enough to lift the Houston Astros to a win.

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

"We were going back and forth today but all that matters at the end of the day is getting the win," Altuve said. "This team is going to be able to do this, come back and swing the bat."

The game was tied 4-all when Altuve connected off Craig Breslow (0-1) and homered into the seats in left field, a ball that barely made it over the wall. The play was reviewed and confirmed after Altuve had already been drenched in Gatorade.

"I was a little scared because I didn't see it, I just saw the fans screaming," Altuve said. "They replayed it, you get scared. You don't want to go back out there, especially when you're all wet because they threw a bucket on you."

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

"We had a tough time keeping guys in the ballpark," Boston manager John Farrell said. "The way they are able to go left, right, left throughout their lineup, sooner or later they end up getting a matchup that they are (looking) for."

Gonzalez was impressed with the big hit by Altuve.

"That was amazing," Gonzalez said. "We were talking about trying to finish the game in that inning. And, well, he did it."

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. 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 to give him a career-high seven this season. 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. 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 RHP 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.