ST. LOUIS (AP) Early on, the Milwaukee Brewers were doing everything they could to keep pressure on Colorado.

By the time their game was over, though, there was no reason to care about what happened at Coors Field.

The Brewers were eliminated from playoff contention Saturday when they squandered a six-run lead in a 7-6 loss to the St. Louis Cardinals, handing baseball's final postseason spot to the Rockies.

Milwaukee reliever Anthony Swarzak gave up a tying, two-run single to Stephen Piscotty in the eighth inning and a go-ahead single to Harrison Bader. Milwaukee tried to rally in the ninth, but Brett Phillips struck out with a runner on second to end it.

"It's a fun group and they found a way I think to lift each other up and that's why we were in a position we were in on the second-to-last day of the season," Brewers manager Craig Counsell said. "It stings."

Milwaukee's loss clinched the second NL wild card for Colorado, which plays at division rival Arizona in the wild-card game Wednesday.

"We knew what was at stake coming in," Brewers third baseman Travis Shaw said. "Unfortunately, today we didn't do our part so it really doesn't matter what happens out West. It took 161 games, but I could not be prouder to be part of this team."

The young Brewers began the day two games behind Colorado and had hoped to force a tiebreaker Monday by winning their last two regular-season games in St. Louis while the Rockies dropped their final two at home to the Dodgers.

Instead, the Brewers (85-76) blew an early 6-0 lead and their surprising season came to an abrupt end.

Milwaukee hasn't reached the playoffs since 2011.

"At the beginning of the year nobody cared, nobody thought there was pressure on us to win the division, but we still played hard, we worked hard and we played together," first baseman Eric Thames said. "We came within one game of being in a postseason spot."

With the Cardinals already eliminated, Domingo Santana hit a two-run homer and Shaw drove in two runs and scored twice as Milwaukee jumped out to a 6-0 lead in the third.

St. Louis scored four times in the bottom half, and Piscotty's single tied it in the eighth. Piscotty was initially called out trying to reach second on the throw home, but then was ruled safe following a replay review. That set up Bader's decisive hit off Swarzak (6-4 overall, 2-1 with the Brewers) with two outs.

"It just shows that we talk about that mental toughness to stay in and realize that you can still make a huge impact in the game if you just stay with the approach," Cardinals manager Mike Matheny said following his team's largest comeback this season.

The loss snapped a three-game losing streak for St. Louis and a four-game winning streak for the Brewers at Busch Stadium.

Santana's 30th home run, a 428-foot shot to right-center field, and Shaw's two-run single highlighted a five-run third for the Brewers. Shaw's single gave him 100 RBIs in a season for the first time.

Counsell showed a sense of urgency by pulling starter Junior Guerra with one out and the bases loaded in the bottom of the third. But Jeremy Jeffress came in and allowed back-to-back, two-run doubles to Paul DeJong and Jose Martinez that cut the Brewers' lead to 6-4.

"They were giving everything they had, but they're tired," Counsell said. "They wanted to be out there. I wanted them out there. That's what happened."

Orlando Arcia's sacrifice fly scored Shaw to make it 1-0 in the second.

Cardinals starter Luke Weaver was pulled after a two-out walk in the fifth.

All six runs Weaver allowed were earned. After going 7-1 with a 2.05 ERA in his first 11 appearances, Weaver finished the season losing his last two with a 16.40 ERA (14 runs in 7 2/3 innings) during that span.

Cardinals: 2B Kolten Wong (lower back tightness) was not in the lineup for the fifth straight game.

UP NEXT

Brewers: RHP Zach Davies (17-9, 3.90 ERA) is coming off a no-decision in his last outing at Cincinnati. He is 2-0 with a 3.41 ERA in six career starts against St. Louis.

Cardinals: RHP Jack Flaherty (0-1, 6.06 ERA) was announced after the game by the club, replacing RHP Carlos Martinez who was the original starter. He will be making his first career appearance against Milwaukee.