ST. LOUIS (AP) -- The Washington Nationals simply took too long to get started this season.
Despite an NL-best record of 30-13 since Aug. 9, the Nationals were eliminated from playoff contention Monday night with a 4-3 loss to the St. Louis Cardinals.
After winning 98 games last year, the defending NL East champions could not overcome a slow start.
"If we would have played the way we played in August and September earlier in the year, we wouldn't be in this situation," shortstop Ian Desmond said.
The Nationals hovered near the .500 mark for the first four-plus months of the season before winning eight of nine in August and nine of 10 during a late charge Sept. 3-13.
The push just came too late.
"We dug a hole and we just couldn't dig out of it," manager Davey Johnson said. "It doesn't feel too good. We gave it a good fight, we just came up short."
The Nationals were eliminated by St. Louis in the division series last season. One year later, they were knocked out by the Cardinals again.
"Now, we're spoilers," Johnson said. "So it's not over for us."
Washington rookie Tanner Roark (7-1) gave up four runs and five hits in five innings for his first loss in four starts. He went 45 2-3 innings before allowing his first home run.
"I didn't have fastball command and I was getting behind hitters," Roark said. "If you do that against a good team, they're going to hit your mistakes."
Carlos Beltran hit a tiebreaking homer and Adam Wainwright earned his 18th win for St. Louis.
Looking for their first NL Central title since 2009, the Cardinals maintained a two-game lead over Cincinnati and Pittsburgh with five to play.
All three teams are headed to the postseason. The Reds and Pirates both won Monday night, clinching at least a wild-card berth when Washington lost.
St. Louis secured no worse than a wild card on Sunday.
Beltran's two-run homer in the fifth off Roark broke a 2-all tie. It was his team-leading 24th of the season and first since Aug. 24.
"The last thing I was thinking about there was a home run," Beltran said. "I've been scuffling a little at the plate, but the way for that to go away is to keep playing and continue to swing the bat."
Wainwright (18-9) gave up three runs and seven hits over seven-plus innings. He struck out five, giving him a career-high 214 on the season.
"This was a great team win. Everybody did their part," Wainwright said.
Jayson Werth hit a two-run homer on the 15th pitch of the game. Wainwright then retired nine in a row and allowed just one run on five hits the rest of the way. He moved into second in the NL in wins behind Washington right-hander Jordan Zimmermann, who has 19.
"The first inning, sometimes great teams are going to put a couple runs together like that," Wainwright said. "The key is to keep pitching and limit the damage."
St. Louis manager Mike Matheny was impressed with the way Wainwright bounced back from the slow start.
"It's amazing that once he gets going, how different his stuff looks," Matheny said. "It doesn't matter what he looks like early, he's going to put it together."
Trevor Rosenthal got two outs for his first career save.
Washington closed to 4-3 in the eighth on singles by Anthony Rendon and Steve Lombardozzi and a groundout from Ryan Zimmerman. St. Louis reliever Carlos Martinez got Werth to ground out with a runner in scoring position to end the threat.
The Cardinals climbed within 2-1 on a run-scoring single by Yadier Molina in the first. They tied it on successive singles from David Freese, Daniel Descalso and Shane Robinson in the fourth.
Robinson replaced Matt Holliday in the lineup. Holliday was a game-time scratch for the second night in a row due to back spasms. He is day to day.
NOTES: Washington OF Bryce Harper broke out of an 0-for-10 skid with a fourth-inning single. ... Cardinals broadcaster Mike Shannon, 74, returned to the booth four weeks after undergoing surgery to replace an aortic valve in his heart. Shannon, who played on the Cardinals' 1964 and 1967 World Series championship teams, made his announcing debut in 1972. He received a standing ovation when his picture was flashed on the video screen during the second inning. ... The Nationals have a 24-8 advantage in homers over their last 17 games. ... St. Louis rookie Michael Wacha (3-1, 3.21 ERA) will face LHP Gio Gonzalez (11-7, 3.39) in the second game of the three-game set Tuesday.