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."
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 Tatis 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 Munoz hit a two-run double. Austin Hedges threw out Munoz to end the inning, a call that was upheld after the Cardinals challenged.
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
Fantasy baseball points ranks: How to keep your entire league active all season long
Like the Detroit Tigers, plenty of fantasy teams have no hope of competing for a title at this time, so how do you keep them active down the stretch? AJ Mass has some ideas.
Olney: Red Sox present, future hinges on Chris Sale's elbow
If ace Chris Sale needs surgery, it would be a body blow not only for this year, but for the future of the Red Sox.
Scherzer (back) expects to return Thursday
Nationals ace Max Scherzer expects to return to Washington's rotation Thursday after missing nearly four weeks with a rhomboid strain, declaring himself "ready to pitch."
Teixeira gives Astros edge vs. Yankees in power rankings
Mark Teixeira sees the Astros as the best team in baseball because of their solidified pitching rotation.
Gallen, Diamondbacks brace for streaking Rockies
The Colorado Rockies will try to maintain a long-overdue hot streak when they open a three-game series against the Arizona Diamondbacks on Monday night in Phoenix.
Twins hope to stay hot against White Sox
Right-hander Kyle Gibson gets the start Monday night as the Minnesota Twins open a six-game homestand against the Chicago White Sox at Target Field in Minneapolis.