SAN DIEGO -- Matt Wieters had been hitless in 17 at-bats against left-handers this season before his luck changed with one mighty swing.
The switch-hitting catcher hit a two-run homer with two outs in the 11th inning, and the St. Louis Cardinals overcame a 3-0 deficit to beat the San Diego Padres 5-3 Sunday and snap a five-game losing streak.
Wieters' shot off lefty Brad Wieck (0-1) reached the balcony on the fourth level of the Western Metal Supply Co. Building in the left-field corner at Petco Park. It was his fourth and came with Kolten Wong aboard on an infield single.
Wieters was well aware of his numbers against lefties.
"It's easy, when you don't have any," he said. "It was a grind earlier in the year for numerous reasons batting right-handed. It was good to get that one. Really, the last four or five at-bats have been better. I had a stretch of six or seven at-bats that were really poor quality at-bats against left-handed pitching, which, when you're not seeing a lot of lefties, can add up on you."
The Cardinals hadn't mustered much offense in the first two games of the series, particularly in a 12-2 loss Saturday night.
"What feels good about it besides the end result was that it was a total team effort," manager Mike Shildt said. "That's the definition of team right there — hard-fought, embracing competition, fought the whole way and got it done. Brought it home."
Manny Machado hit a two-run home run in the fourth, giving the Padres three players with at least 20, and Eric Hosmer had three hits. San Diego had its four-game winning streak snapped.
Carlos Martínez (2-0) pitched 2 2/3 innings of relief for the win and Dominic Leone got the final two outs for his first save.
The Cardinals had erased a 3-0 deficit on Yairo Muñoz's two-run double in the sixth and an unearned run in the eighth after Machado and Franmil Reyes each committed an error.
The Padres loaded the bases on three straight walks with one out in the eighth and failed to score after Manuel Margot hit into a double play. Margot originally was called safe, but it was overturned after the Cardinals challenged.
"This one will be bitter all night long, probably," manager Andy Green said. "We gave ourselves a lot of opportunities to win a baseball game and just didn't come through. They came through."
Machado joined Reyes and Hunter Renfroe, who each have 24 homers, among Padres players with at least 20.
The $300 million slugger has three homers in two games and 10 in his last 15. His two-run shot came off one-time Padres pitcher Miles Mikolas with one out in the first and Hosmer aboard on a double.
"We don't depend on home runs," Machado said. "We score runs different ways, stealing bases, being aggressive on the base paths. ... Home runs just come. You don't go out there swinging for home runs."
Hosmer's third straight hit, a two-out double to right-center in the fifth, brought in speedy rookie Fernando Tatís Jr. from first base.
Hosmer had four hits in Saturday night's 12-2 win, when Machado and Reyes each had two homers, including on consecutive pitches in the second inning. Hosmer has 15 hits in his last seven games.
Left-hander Joey Lucchesi was cruising before loading the bases on two walks and a single with one out in the sixth and making way for Luis Perdomo. Tyler O'Neill struck out before Muñoz hit a two-run double. Austin Hedges threw out Muñoz to end the inning, a call that was upheld after the Cardinals challenged.
The Cardinals had runners on first and second with one out in the seventh before Craig Stammen came on and struck out rookie Tommy Edman and got José Martínez to ground out to end the threat.
St. Louis tied it in the eighth. Paul Goldschmidt beat out an infield single and took second on Machado's throwing error, advanced on O'Neill's single to right and then scored when Reyes booted the ball for an error.
"It just happens," Machado said. "I should have probably held it. He is a pretty good, above-average runner. It's just one of those plays that if I would have made a better throw I would have got him out. It just tailed away on us and it led to that inning to tie up the ballgame. That's a tough error on me."
Cardinals: RHP Jack Flaherty (4-5, 4.75) is scheduled to start Tuesday night in the opener of a three-game series at Seattle.
Padres: Rookie LHP Logan Allen (2-0, 1.38) looks to win his third straight start in the opener of a three-game series against the San Francisco Giants, who will counter with RHP Jeff Samardzija (4-7, 4.52).
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP—Sports