ST. LOUIS — Harrison Bader tripled and homered to help the St. Louis Cardinals clinch a post-season berth on the final day of the regular season with a 5-2 win over Milwaukee, and the Brewers also earned a playoff spot Sunday via help on the West Coast moments later.

St. Louis (30-28) will be the fifth seed in the NL and open a three-game wild-card series at San Diego on Wednesday. By winning, the Cardinals avoided having to travel to Detroit for two makeup games Monday. St. Louis finished the regular season with 23 games in 18 days as it made up a slew of postponements caused by a coronavirus outbreak in the clubhouse.

“You had to throw some of the expectations out the window not knowing what to expect after taking those couple weeks off and all those doubleheaders and so many new guys,” Cardinals first baseman Paul Goldschmidt said. “It was very different, very fulfilling to make the playoffs.”

The Brewers (29-31) locked up the eighth seed and a third consecutive post-season berth after the Padres beat San Francisco 5-4 in a game that ended about 15 minutes after St. Louis' victory. The Giants finished with an identical record as the Brewers but lost out on a tiebreaker due to an inferior intradivision record.

“It’s fitting for 2020 and everything we went through,” Brewers left fielder Christian Yelich said. "It felt just as good as past years. This year’s a unique one. There’s so many challenges we had to go through on a daily basis behind the scenes, things you don’t deal with in a normal year.”

Milwaukee will face the top-seeded Dodgers in Los Angeles in a three-game series that also starts Wednesday.

The Brewers haven't had a winning record at any point this season. Milwaukee and Houston will be the first teams ever to qualify for the playoffs with a losing mark.

“It’s a celebration," Brewers manager Craig Counsell said. “We’re in the playoffs. That’s how you see it. There’s no reason to apologize for getting into the playoffs.”

Cardinals starter Austin Gomber allowed one run, one hit and two walks and struck out three over four innings.

Giovanny Gallegos (2-0), Génesis Cabrera and Alex Reyes combined to pitch the final five innings. Reyes got his first save.

“We’d have been happy getting in as the eight seed,” Cardinals manager Mike Shildt said. “We’d have been happy being the one seed, but people can say we got in if there was no expanded playoffs so that’s even another feather in this group’s cap.”

Brett Anderson (4-4) surrendered a triple to Bader and a walk to Tyler O’Neill to start the third inning before departing with a blister on his left index finger. Anderson opened the season on the injured list with a blister on the same finger and did not make his debut until Aug. 3.

Freddy Peralta replaced him a day after being activated from the paternity list, and O’Neill promptly stole second. Kolten Wong then hit a line drive off Peralta’s leg that Peralta threw into right field to score Bader and O’Neill.

Paul Goldschmidt and Paul DeJong each added RBI singles to push the St. Louis lead to 4-0.

After Milwaukee scored in the top of the fifth, Bader hit his fifth home run of the season.

“That was a big counterpunch,” Shildt said of Bader. “Got them on their heels again.”

THREE TIMES THE FUN

Yadier Molina grounded into a triple play in the eighth inning when he hit a one hop grounder to Jace Peterson at third base in the eighth inning. It was Milwaukee’s first triple play since Sept. 23, 2016, when Cincinnati’s Joey Votto lined out to first base. Molina was also the last Cardinals player to hit into a triple play when he grounded out to third base at Boston on Aug. 15, 2017.

TRAINING ROOM

Brewers: Counsell said it was too early to prognosticate Anderson's status after departing with the blister.

Cardinals: St. Louis president of baseball operations John Mozeliak announced that RHP Dakota Hudson will have Tommy John surgery on his right elbow Monday. Hudson went 3-2 with a 2.77 ERA in eight starts before leaving his start on Sept. 17 at Pittsburgh with right elbow discomfort after two innings.

UP NEXT

Brewers: The Brewers head to Los Angeles and will likely be without two of their top starters in Anderson and Corbin Burnes, who sustained a left oblique injury on Thursday.

Cardinals: This will be the fourth post-season series between St. Louis and San Diego, who faced each other in 1996, 2005, and 2006 in the Division Series.

___

More AP MLB: https://apnews.com/MLB and https://twitter.com/AP_Sports