PHILADELPHIA -- Uncertain of the identity of their starting pitcher as of Thursday afternoon, the Philadelphia Phillies ended the evening with an improbable victory.

Ryan Howard hit a grand slam in a five-run eighth inning, and the Phillies rallied for a 6-5 win over the Houston Astros.

Howard's slam, off reliever Tony Sipp, was the 13th of his career, extending his franchise record. His 18th homer of the season allowed the Phillies to complete a sweep of the three-game series.

"I really wasn't trying to hit a home run," Howard said. "Really I was trying to get one run across, trying to find a way -- have a good at-bat, battle, try to get Marlon (Byrd) up to the plate. It worked out."

Sipp said he wanted to throw a high fastball on the 3-2 pitch to Howard, the eighth pitch of the at-bat. Instead the Houston reliever threw the ball down and in, and Howard hit it into the center field seats.

"He put a pretty good swing on it," Sipp said. "I didn't think it was going out. I knew it was high enough, but he didn't drive it like he usually does."

Howard, for his part, said he was certain the ball was leaving the park, right off the bat. It was his second game-winning hit in the series. He also had the decisive single in the 15th inning of the Phillies' 2-1 victory Tuesday night.

"He definitely hurt us in this series," Astros manager Bo Porter said. "Give him credit -- he really put a charge into it."

Houston left fielder Chris Carter hit a pair of two-run homers off emergency starter Sean O'Sullivan, and right fielder Marc Krauss added a solo shot, staking the Astros to a 5-1 lead.

Phillies catcher Carlos Ruiz led off the eighth inning with a double off reliever Josh Fields, and third baseman Cody Asche followed with an RBI single.

Pinch hitter Domonic Brown struck out, but center fielder Ben Revere beat out an infield single and Sipp (2-2) replaced Fields. Shortstop Jimmy Rollins singled to load the bases, and second baseman Chase Utley flied out to short left field. That set the stage for Howard.

Mario Hollands (2-1) worked two scoreless innings in relief for the victory. Jonathan Papelbon pitched a perfect ninth for his 27th save.

Carter, who has 24 home runs this season, went deep in the first and third innings off O'Sullivan, who was summoned from Triple-A Lehigh Valley earlier in the day after the Phillies traded Thursday's scheduled starter, Roberto Hernandez, to the Los Angeles Dodgers for two players to be named.

O'Sullivan, 5-9 with a 4.57 ERA in 21 starts for the IronPigs, caught a flight at 3:45 p.m. from Toledo, where Lehigh Valley was scheduled to play the Mud Hens. He arrived at Citizens Bank Park at 6 p.m., an hour before he made his second major league start of the season, only to be tagged with five runs and seven hits in six innings.

He gave up back-to-back homers in Houston's three-run first inning, as Krauss followed Carter's first homer of the night with his sixth of the season.

"I never had to rush the same day and get on the mound that night," said O'Sullivan, who struck out four and walked two. "That was unique, definitely something I'll be able to talk about to other players in the future. But I'm happy to be here, absolutely. I could have shown up at 7:02 and I would have been ready to go. I'm just happy to be here, happy for the opportunity."

Carter had his fifth multi-homer game of the season and the eighth of his career. He homered to left on an 0-1 pitch from O'Sullivan in the first inning after Castro drew a one-out walk. Krauss followed with his homer, making it 3-0.

Ruiz singled home a run in the second inning, ending an 0-for-13 slump, but Carter struck again in the top of the third after Castro's leadoff single. This time, Carter ripped a 1-0 fastball over the center field fence, giving Houston a four-run advantage.

Astros starter Collin McHugh pitched seven innings, allowing one run and five hits while striking out eight. He didn't walk a batter.

NOTES: The Philadelphia Daily News confirmed an MLB.com report that Phillies LHP Cliff Lee, on the disabled list for the second time this season with a strained elbow, will not need surgery. Lee, who will not pitch again this season, instead will rest his arm in hopes of being ready for 2015. ... Astros OF George Springer, on the disabled list since July 20 with a strained left quad, went 1-for-1 with a walk and a double in a rehab game for Class A Quad Cities on Wednesday night but was removed from the game with what the Astros described as mild discomfort in the muscle. His condition will be re-evaluated Friday in Houston. ... Phillies CF Ben Revere had his fourth four-hit game of the season in Wednesday's 10-3 victory over the Astros. According to the Elias Sports Bureau, the only Phillie in the last 30 years with more four-hit games in one season was Shane Victorino, who had five in 2009.