Gary A. Vasquez-USA TODAY Sports

Luke Voit, Eric Hosmer and Ha-Seong Kim all drove in ninth-inning runs as the visiting San Diego Padres rallied for a 4-2 victory Sunday over the Los Angeles Dodgers to avoid a four-game series sweep.

The Padres were two outs away from leaving Los Angeles empty handed when they came back to earn just their second victory in the last eight games.

San Diego rookie left-hander MacKenzie Gore settled down from a shaky start to give up one run on five hits over 5 2/3 innings with four walks and three strikeouts. Nick Martinez (3-3) added 2 1/3 scoreless innings to earn the win.

Clayton Kershaw pitched seven scoreless innings for the Dodgers to rebound from a start at Colorado in which he gave up a season-high six runs. The left-hander gave up just four hits and one walk while striking out eight.

Down 1-0 in the ninth, the Padres stormed back against Dodgers closer Craig Kimbrel after Jake Cronenworth hit a line drive off the back of Kimbrel's right shoulder with one out. Kimbrel (1-4) remained in the game but gave up a game-tying double off the top of the left-field fence to Voit.

Hosmer followed with a go-ahead RBI single before Kimbrel was replaced by Yency Almonte. With two outs, Kim hit a two-run home run to left field, his fifth of the season.

The Dodgers looked like they were about to pour it on early. Mookie Betts, who missed the previous 15 games with a cracked right rib, doubled to lead off the bottom of the first. Trea Turner brought him home with a double of his own, giving Los Angeles the lead on Gore's sixth pitch.

The Dodgers loaded the bases in the opening inning before Gore struck out Trayce Thompson to end the threat. Los Angeles had another scoring chance in the fourth, but Betts was thrown out at home plate by Jurickson Profar after a Freddie Freeman single to left.

The Dodgers put two aboard in the ninth against Padres left-hander Taylor Rogers with Freeman at the plate as the tying run. But they only got a sacrifice fly from Freeman, and Rogers went on to earn his 23rd save.

More must-reads:

TODAY'S BEST
Nuggets melt down under Timberwolves' pressure to go down 0-2
Watch: Knicks' Donte DiVincenzo makes, absorbs big shot to win Game 1
Bruins take series opener over Panthers in 5-1 rout
Spurs' Victor Wembanyama unanimously wins NBA Rookie of the Year award
Phillies remain MLB's hottest team with dominant Zack Wheeler performance
Heat president Pat Riley calls out Jimmy Butler twice following playoff exit
Brooks Koepka sets up epic clash with Scottie Scheffler at PGA Championship
How Tom Brady's investment in English soccer team cratered
Week 12 NASCAR power rankings: Kyle Larson distances himself with historic win
Ex-GM confident 49ers can avoid breaking the bank on Brock Purdy extension
Five most surprising breakout players in this MLB season
The most exciting offseason addition for every NFL team
Bengals exec declines Patriots interview for de facto GM job
Snoop Dogg to be title sponsor of college football bowl game
A's place struggling starter on injured list
Longtime Saints OL, three-time Pro Bowler agrees to deal with AFC West team
Report: 10-time All-Star 'wants to re-sign' with Clippers
Kendrick Perkins 'wishes' LeBron James would make drastic career decision
Snoop Dogg makes big college football announcement
Pat Riley calls out Jimmy Butler over recent comments