DETROIT -- For five innings, the Houston Astros were one pitch away from blowing an important game.
Their relievers never gave the Tigers that pitch.
Five Houston relievers threw shutout innings, and the Astros' three early homers held up in a 5-4 victory over Detroit on Tuesday night.
"None of those guys had a margin for error," Houston manager A.J. Hinch said.
Houston maintained a three-game lead over the Oakland Athletics in the AL West.
Jose Altuve homered on the first pitch of the game, and the Astros hit two more homers in the first four innings to go up 5-0.
Houston starter Framber Valdez, though, couldn't maintain that big lead.
Valdez allowed four runs in the bottom of the fourth, including a three-run homer by JaCoby Jones. That ended his night and started a parade from the Houston bullpen.
Hector Rondon gave up two hits in the seventh but got out of the jam, and Collin McHugh and Roberto Osuna retired the last six batters in order. Osuna struck out rookie Christin Stewart to end the game and earn his 17th save in 18 opportunities.
"It's hard to pick which was my favorite reliever of the night, because they all came in and were effective," Hinch said. "The way the game started, I didn't expect a bullpen day, but I looked up and it was suddenly a one-run game."
Jordan Zimmermann (7-7) allowed five runs on six hits in five innings. He walked one and struck out three.
"I just didn't have my best stuff," he said. "My fastball command wasn't there, so my first pitch wasn't where I wanted it and Altuve's a great hitter. It seems like my starts lately have been very good or very bad."
Detroit got four scoreless innings from its bullpen.
"Those guys did a fantastic job of keeping us in the game," Tigers manager Ron Gardenhire said. "They've got so many great arms in their bullpen, though, and we could never get one more big hit."
After Altuve gave Houston the early lead, Tony Kemp hit a two-run homer in the second inning.
Tyler White hit Houston's third homer, a two-run shot into the Astros bullpen with one out in the fourth.
"We try to get runs any way we can," White said. "Altuve starting the game with a homer was an unbelievable way to get us going, and then Kempie came up with a big swing."
The Tigers scored all their runs with two outs in the fourth. With runners on the corners, Dawel Lugo hit what looked like a routine grounder to short, but the ball took a bad hop and went over Carlos Correa's head for an RBI single.
Jones then lined a 3-1 fastball into the left-field stands for his 11th homer of the season.
"I needed to refocus after the bad hop, because that's something I can't control," Valdez said through a translator. "It's just something that happens."
Jones came into the game hitting .183 with 51 strikeouts in his last 40 games but managed five homers during the slump.
"He can always hit a baseball a long way," Gardenhire said. "The problem comes when he tries to hit home runs. That screws him up, and he starts chasing. When he stays in the strike zone, he's a good hitter."
Houston missed a chance to add to its lead in the seventh.
Louis Coleman hit the first two batters, and a passed ball moved the runners to second and third with one out. Gardenhire intentionally walked Correa, loading the bases, and brought in lefty Daniel Stumpf.
Stumpf got Josh Reddick to pop out and was immediately replaced by right-handed Victor Alcantara. Tyler White hit a hard grounder to third and was originally ruled safe after Jeimer Candelario didn't field the ball cleanly. However, a replay review showed the throw beat White to first, ending the inning.
More AP MLB: https://apnews.com/tag/MLB and https://twitter.com/AP-Sports
The Los Angeles Dodgers ruined Arizona's season.
Two right-handers who hope to remain part of the starting rotation next season will go head-to-head when the Los Angeles Angels host the Texas Rangers on Monday in the opener of a three-game series at Angel Stadium.
Two teams playing out the string of losing seasons will open a three-game series Monday night when the San Diego Padres visit the San Francisco Giants.
Minutes after the St. Louis Cardinals coughed up a lead and lost on July 14 to the Cincinnati Reds to drop to 47-46, manager Mike Matheny said they had a good run in them.
The Oakland Athletics will travel to Seattle with a little extra luggage.
The Colorado Rockies have a short, simple agenda as they begin a four-game series Monday with the slumping Philadelphia Phillies.