HOUSTON (AP) -- Tony La Russa clicked photos with his cell phone as the St. Louis Cardinals danced, yelled and doused each other with beer and champagne in a celebration none of them envisioned less than a month ago.
Chris Carpenter and the Cardinals completed one of baseball's greatest comebacks on Wednesday night, clinching the NL wild card with an 8-0 win over Houston and a later loss by Atlanta.
The Cardinals got their playoff spot when the Braves fell to Philadelphia 4-3 in 13 innings.
St. Louis trailed Atlanta by 10 1/2 games on Aug. 25, then won 23 of the last 31 games to finish its improbable charge. The Braves fueled the Cardinals' surge by losing 18 of their last 27.
"We came from so far back," La Russa said. "It's nice to be part of history because the club deserved it. We were great for four months, and we had a little bad period. We really came charging back. Adversity was something that we embraced."
The Cardinals will open the postseason on Saturday at NL East champion Philadelphia. In the other NL playoff matchup, Arizona visits Milwaukee.
"We're just glad we have a chance to play in October," Cardinals first baseman Albert Pujols said.
St. Louis made quick work of the punchless Astros, then rushed back into the clubhouse to watch the end of the Atlanta game. With the Braves two outs from defeat, a clubhouse attendant wheeled in a dolly stocked with cardboard boxes of beer.
And when Freddie Freeman rolled into a season-ending double play, the party began. The Cardinals passed out black caps with "2011 MLB Playoffs" emblazoned on top and black T-shirts with NL wild-card logos.
Within minutes, the floor of the clubhouse was littered with bottle caps and corks.
"It's a great feeling to be able to come from so far down," former Astro Lance Berkman said. "We felt like we had a run like this in us, and we executed it just in the nick of time. And here we are."
Carpenter (11-9) pitched like an ace, striking out 11 and allowing two hits in his 15th career complete-game shutout. The Cardinals poured onto the field after Carpenter fielded J.D. Martinez's weak grounder for the final out.
"It was exciting, there's no doubt about it," Carpenter said. "The way these guys have played the past month-and-a-half has been amazing, every single night grinding, playing their butts off, not giving up.
"We continued to give ourselves an opportunity and now we are here."
The Braves and Cardinals entered Wednesday's regular-season finales with 89-72 records.
Atlanta's game started an hour earlier, but the Cardinals virtually took away any hope for a Houston victory in the first inning, jumping to a 5-0 lead against Brett Myers (7-14).
Pujols and Berkman drove in runs with singles, and David Freese doubled to left-center before Myers even recorded an out. Berkman scored when Skip Schumaker 's hard grounder ricocheted off Myers' glove for an infield hit, and Freese came home on Nick Punto 's single to right.
"I'm glad that we contributed early in the game," Pujols said, "and Carpenter obviously took them out and took care of business."
Carpenter had struggled at Minute Maid Park lately, going 0-3 with a 4.62 ERA in his last five starts here, but he was in total command from the start Wednesday, striking out five of the first nine hitters. He also had an RBI single in the third to drive in Freese, who reached base when right fielder Brian Bogusevic dropped his fly ball for an error.
Freese led off the fifth with a double to right center, the Cardinals' 10th hit of the game. Myers, 4-0 with a 1.24 ERA in his last five starts, hadn't allowed more than nine hits in a start since Aug. 6.
Freese scored on Schumaker's groundout to shortstop Clint Barmes for a 7-0 lead, equaling the most runs given up by Myers in 33 starts this season. Wilton Lopez replaced Myers for the start of the sixth.
"I really wanted to win," Myers said. "I really wanted to go out there and put them out. It didn't work out." As the Astros batted in the seventh, the scoreboard in left field posted a 3-3 tie in the Phillies-Braves game, prompting a roar from the large contingent of Cardinals' fans in the stands behind the St. Louis dugout. Carpenter then struck out Bogusevic and Jimmy Paredes to wrap up another easy inning.
"He was so sharp, razor sharp," La Russa said. "The catcher ( Yadier Molina ) said it was like playing catch. He put the glove down, and there it was. It was just amazing. He did exactly what we needed, and we got some offense for him early, and that helps a little bit."
Allen Craig hit a solo homer in the ninth off Lance Pendleton .
Amid the chaos afterward, Pujols and Berkman embraced.
"Any time you're on a playoff team and you make a run like this, you invest a lot of yourself in the season with a great group of guys," Berkman said. "It just makes it special."
NOTES: La Russa said LF Matt Holliday (right hand injury) and SS Rafael Furcal (left hamstring) were unavailable Wednesday night. ... Cardinals pitching coach Dave Duncan rejoined the team after missing more than a month to tend to his ailing wife. Jeanine Duncan is recovering from surgery on Aug. 21 to remove a brain tumor. Dave Duncan , La Russa's trusted assistant since the early 1980s, did not know how long he would be able to stay with the club because his wife has more medical appointments scheduled. ... The sparse crowd offered a standing ovation to Astros owner Drayton McLane after a video tribute was shown on the giant scoreboard between the second and third innings. McLane is still waiting for Major League Baseball to approve his sale of the team to Houston businessman Jim Crane for $680 million. General manager Ed Wade said before Wednesday's game that McLane still has the final say on all baseball decisions.