HOUSTON (AP) - Chris Carpenter and St. Louis completed one of the more remarkable comebacks in baseball history, clinching the NL wild card Wednesday night 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. The Cardinals won 23 of their last 31 games.
The Cardinals will open the postseason on Saturday at NL East champion Philadelphia.
Carpenter (11-9) struck out 11 and allowed two hits in his 15th career complete-game shutout as St. Louis kept up its improbable September charge. The Cardinals won for the 23rd time in 31 games, having trailed Atlanta by 10 1/2 games on Aug. 25.
Houston took a 5-0 lead in the first inning against Brett Myers (7-14).
Albert Pujols and Lance Berkman drove in runs with singles, and David Freese doubled 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.
Phillies 4, Braves 3, 13 innings
ATLANTA (AP) - Atlanta closer Craig Kimbrel surrendered the tying run in the ninth, and Hunter Pence came through with a two-out, run-scoring single in the 13th to give Philadelphia the win that ended the Braves season without a trip to the playoffs that looked like a certainty just a few weeks ago.
The game ended more than an hour after St. Louis routed Houston 8-0 to claim at least a share of the wild card. The Cardinals earned it outright when David Herndon earned his first career save by getting Freddie Freeman to hit into a season-ending double play.
The Braves were 10 1/2 games ahead of St. Louis before play on Aug. 26. They were still up by 8 1/2 games on the morning of Sept. 6. They became the first team in major league history to blow a lead of at least eight games for a playoff spot in September.
The Braves lost five straight to end the regular season and were 9-18 in the final month.
Brewers 7, Pirates 3
MILWAUKEE (AP) - Zack Greieke capped a perfect season at home to help Milwaukee clinch home-field advantage in the first round of playoffs.
Carlos Gomez, Corey Hart and Jonathan Lucroy homered for the Brewers, who set a franchise record with 96 wins and open an NL division series against the Arizona Diamondbacks at Miller Park on Saturday.
If the NL Central champions had tied with NL West winner Arizona in the standings, the Brewers would have started the playoffs on the road.
Ryan Braun's pursuit of Mets shortstop Jose Reyes for the NL batting title ended early. He went 0 for 4 to finish at .332. Reyes hit .337.
Greinke (16-6) allowed two runs in six innings to finish 11-0 in 15 starts at home, where the Brewers were a major league best 57-24.
Milwaukee (96-66) finished with one more win this season than in 1979 and '82, when the franchise made its only World Series appearance.
Gomez hit a three-run shot with two outs in the fourth off rookie starter Jeff Locke (0-3) that put Milwaukee ahead 5-1.
Pittsburgh (72-90) wrapped up its 19th straight losing season with another defeat in Milwaukee. Pittsburgh is 4-38 in Milwaukee since 2007.
Dodgers 7, Diamondbacks 5
PHOENIX (AP) - Matt Kemp hit a two-run homer to become the first Dodger in 70 years to lead the NL in home runs and RBIs.
Arizona locked up its NL West title last week and will open the NLDS on the road against Milwaukee. The Diamondbacks were quiet in the season finale until the bottom of the ninth when Cole Gillespie hit a grand slam off Ramon Troncosco and Henry Blanco followed with a solo shot.
Kenley Jansen ended the rally, getting the final two outs for his fifth save.
Kemp hit his 39th homer in the seventh to pass Milwaukee's Prince Fielder for the league lead and finished with 126 RBIs.
Dodgers infielder Eugenio Velez made history when he grounded out as a pinch-hitter in the seventh to set a modern-day record for non-pitchers with his 46th straight hitless at-bat.
Arizona managed three hits in seven innings against Ted Lilly (12-14) and Diamondbacks starter Joe Saunders 12-13) allowed five runs and nine hits before leaving after six innings. Mets 3, Reds 0
NEW YORK (AP) - Jose Reyes bunted for a base hit in the first inning against Cincinnati and was lifted for a pinch-runner but it was enough to give him the NL batting title with a .337 average.
Ryan Braun, who was at .334 heading into Milwaukee's regular-season finale against Pittsburgh, went 0 for 4 and finished at .332.
Miguel Batista (5-2) pitched a two-hitter for his 11th complete game, his first since July 19, 2006, for Arizona. He allowed a one-out single to Edgar Renteria in the first and leadoff double to Chris Heisey in the second.
Mike Baxter hit his first major league homer, a two-run shot off Edinson Volquez (5-7) in the sixth. Nick Evans singled in a run in the fourth.
The Mets their third straight losing season at 77-85, two more losses than last year.
Cincinnati also had a disappointing season, winding up at 79-83 after winning the NL Central last year with a 91-71 record.
Rockies 6, Giants 3
SAN FRANCISCO (AP) - Kevin Kouzmanoff had three hits and drove in two runs and Colorado sent the reigning World Series champions into an early offseason.
Drew Pomeranz (2-1) outpitched fellow rookie Eric Surkamp (2-2) in their second matchup in two weeks and Jordan Pacheco added two RBI singles for the Rockies (73-89), who snapped a seven-game losing streak to the Giants.
San Francisco (86-76) wound up in second place in the NL West behind Arizona, becoming the first defending champion not to make the playoffs since St. Louis in 2007.
Mark DeRosa hit a two-run single for the Giants.
Nationals 3, Marlins 1
MIAMI (AP) - Stephen Strasburg allowed one hit and struck out 10 in six scoreless innings to earn his first win since July 2010, and Florida bid their much-maligned stadium goodbye.
Next year the Marlins move into a new ballpark with new manager Ozzie Guillen, who held his introductory news conference before the game.
Strasburg (1-1) made his fifth start since returning from elbow surgery. He finished the season with 24 strikeouts in 24 innings and an ERA of 1.50.
The Nationals finished 80-81 - their sixth consecutive losing season. Florida wound up last in the NL East at 72-90.
Drew Storen completed a three-hitter with a perfect ninth for his 43rd save in 48 chances.
Ian Desmond had a two-run single for Washington.
Florida scored in the seventh when Gaby Sanchez's fly dropped between outfielders for an RBI double.
Padres 9, Cubs 2
SAN DIEGO (AP) - Will Venable hit his first career grand slam and Nick Hundley hit a three-run shot to lift the normally punchless San Diego to a season-ending victory.
Cubs shortstop Starlin Castro became the youngest player - at 21 years, 188 days - to lead the NL with 207 hits. He doubled in the eighth to reach base in a career-high 40th straight game and extended his hitting streak to 10 games. He also hit a sacrifice fly in the fifth.
The teams both finished 71-91.
Wade LeBlanc (5-6) allowed two runs and five hits in seven innings, struck out three and walked two.
Ryan Dempster (10-14) allowed nine runs and eight hits in 5 2-3 innings, struck out seven and walked four. The 14 losses extended his career-high, and he matched his career-high with his sixth straight loss, over eight starts.