HOUSTON - If the Philadelphia Phillies underestimated the Astros, they learned a tough lesson: Even the worst team in baseball can play spoiler and derail a playoff contender.
Justin Maxwell sparked a four-run seventh inning with a bloop double that scored two, and the Astros held on for a 7-6 victory over Philadelphia on Sunday afternoon to avoid their 100th loss and put a dent on the Phillies' playoff hopes.
Matt Dominguez followed with a two-run single off Phillippe Aumont to cushion the lead for the Astros, who won their second straight and third in four tries against the Phillies, who came to Houston sporting a seven-game winning streak.
"We don't have any more room for error," said Jimmy Rollins, who went 3-for-4 with a double, a walk, two runs scored and a stolen base.
Philadelphia entered the game three games back of St. Louis and Los Angeles for the second NL wild-card berth and with Pittsburgh and Milwaukee also ahead of them.
Ryan Howard and Domonic Brown each drove in two runs and Chase Utley added one for the Phillies, who led 4-2 after the fifth inning.
After the Astros had taken a 7-4 lead, Brown's two-run double off Astros reliever Mickey Storey in the eighth inning drove in Carlos Ruiz and John Mayberry Jr. to get the Phillies within one run.
But that is as close as the Phillies would get.
Astros right-hander Wilton Lopez pitched 1 2/3 scoreless innings for his sixth save of the season.
Left-hander Wesley Wright pitched a scoreless seventh for the win to improve to 2-2.
Astros right-hander Jordan Lyles (4-11) gave up four runs on five hits over five innings. Lyles, who was aiming to win back-to-back starts for the first time this season, struck out six and walked four.
"The guys don't quit," Astros manager Tony DeFrancesco said. "It seems like they've got some life and fire."
The turn of events over the weekend left the Phillies baffled.
"I've got nothing," Howard said as he walked away from his locker after the game.
Phillies manager Charlie Manuel was more eloquent regarding his team's struggles against the Astros.
"It's hard to explain because we come in here and, of course, we don't think we are going to get beat," Manuel said. "We thought we were going to win the series.
"At the same time, when I go back and think about it, they always play us good here. On top of that, when you look at it, they deserved to win the games they won. They did it when it counted, and we didn't."
Phillies left-handed reliever Antonio Bastardo was charged for two runs over 1/3 of an inning to drop to 2-5.
Philly right-hander Roy Halladay pitched six innings and got a no-decision. He allowed three runs on six hits while striking out seven and walking two.
"It is definitely a different, odd team to pitch to," Halladay said of the Astros. "Sometimes they are aggressive, sometimes they are not. Sometimes they are taking. I think the whole series, we never figured out what their plan was."
The Phillies were looking to rebound from a frustrating shutout loss Saturday to make the Astros 100-game losers for the second consecutive season.
Houston reached the dreadful mark in 2011 for the first time in franchise history, when it finished 56-106.
The Astros used the long ball to stay afloat through the first six innings.
Carlos Corporan's fourth home run of the season in the sixth got Houston within a run of the Phillies at 4-3. That came after Scott Moore hit a two-run home run in the third inning to give the Astros a 2-1 lead. It was Moore's eighth homer of the season.
The Phillies had jumped to a 1-0 lead in the first inning.
Rollins doubled to lead off the game, reached third on a sacrifice bunt by Juan Pierre and scored on an Utley sacrifice fly to right to give the Phillies a 1-0 lead.
Rollins sparked the Phillies again with two outs in the fifth inning.
He singled on a line drive to right and, with Pierre batting, stole second and reached third on an errant throw by catcher Carlos Corporan.
Pierre scored Rollins with a double to left that dropped in front of Justin Maxwell and J.D Martinez to make it 2-2.
Lyles intentionally walked Utley, setting the stage for Howard, whose line drive was good enough for a two-run double, though not the triple he attempted to get, to give the Phillies the 4-2 lead.
"It was just another fifth," said Lyles, who has struggled during that inning in games past. "That number five gets stuck in my head."
DeFrancesco said it was all part of Lyles' development.
"The fifth inning is something he's got to get through," DeFrancesco said. "I don't want to take him out in the sixth inning and put his confidence back down. We want him to finish the season strong."
NOTES: Astros infielder Tyler Greene started at shortstop in place of Jed Lowrie, who experienced soreness in his right knee. DeFrancesco originally planned to start Greene at second to rest All-Star Jose Altuve but kept Altuve in the lineup. ... The Phillies had not lost consecutive games since dropping two to the Mets on Aug. 28-29. ... The Astros' Class A Lancaster Jayhawks captured the California championship Saturday night with a 3-2 win over Modesto for the three-game series sweep. It is the team's first title in 17 seasons. ... Rollins' steal was his 30th of the season, marking the 10th time he's had at least 30 steals in a season.