David Eckstein singled in the winning run with one out in the 10th inning and the San Diego Padres beat the Arizona Diamondbacks 4-3.
The Padres won for just the fourth time in 17 games.
Eckstein, who entered the game for defensive purposes in the top of the inning, lined a shot just past first baseman Josh Whitesell to bring in Kevin Kouzmanoff.
Kouzmanoff started the winning rally with a one-out double to left-center off Esmerling Vasquez, his third straight hit. Nick Hundley and Chris Burke, who was with Arizona last year, walked to load the bases and bring up Eckstein.
Cla Meredith pitched a perfect 10th for the win.
After the game, the Arizona Diamondbacks fired Bob Melvin, hoping a new manager will be able to get the most out of their talented core of young players.
The 47-year-old Melvin's firing comes after a disappointing start by the Diamondbacks (12-17), who entered Thursday 8½ games behind the Los Angeles Dodgers in the NL West.
SportsWrap
The top sports headlines of the day
The 2007 NL Manager of the Year went 337-340 in four-plus seasons.
The Diamondbacks will name A.J. Hinch, their vice president for player development, as Melvin's replacement on Friday, according to a person familiar with the move who requested anonymity because the announcement had not been made.