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
Law: Reds risk overpaying to finally land Sonny Gray
Beyond the prospects moving between the three teams involved, Cincinnati surrendered extra value that could haunt the team.
Does Sonny Gray trade make Reds better or just more interesting?
Liberating the veteran from his struggles in Yankee Stadium is Cincinnati's latest move to try returning to relevance in the NL Central.
Reds strike deal for Yanks' Sonny Gray after pitcher inks extension
The Yankees have traded starting pitcher Sonny Gray to Cincinnati, the teams announced Monday, finalizing a days-in-the-making deal that ends Gray's topsy-turvy stint with New York.
Ranking every current Hall of Famer by tiers
From Ruth, Mantle, Mays & Co. to players we're not sure belong, we sort out how every Hall of Famer rates -- and how this year's crop fits in.
2019 Hall of Fame ballot: Who did our voters pick?
Roy Halladay and Mariano Rivera are both on their way to Cooperstown, according to our voters. Could Edgar Martinez be joining them in his last year on the ballot?
How social media is negatively impacting Hall of Fame voting
Deciding which stars deserve a spot in Cooperstown should be a joyful exercise, but backlash to voters' selections is sucking the fun out of the debate. Plus, a look at what players can do about the state of free agency.