PHOENIX -- Paul Goldschmidt hit a leadoff home run in the bottom of the ninth inning and the Arizona Diamondbacks ended a four-game losing streak, beating the Miami Marlins 3-2 Tuesday night.
Goldschmidt's drive bounced high off the batter's backdrop in deep centre field. His 17th homer of the season was his second in as many nights, and the second game-ending home run of his career.
Martin Prado also homered for the Diamondbacks.
David Hernandez (3-4) threw a perfect top of the ninth for the win. Chad Qualls (2-1) lost for the first time in 27 appearances, with Goldschmidt connecting on his second pitch.
Nathan Eovaldi, activated from the disabled list and making his first start since Sept. 30, scattered three hits over seven innings for the Marlins, who had won two in a row. Miami has won three straight only twice this season.
The Marlins took a 2-0 lead in the fourth against Randall Delgado. Derek Dietrich hit an RBI triple and scored on Adeiny Hechavarria's single.
Eovaldi, who had missed the season's first two-plus months with inflammation in his right shoulder, walked Miguel Montero with two outs in the fourth and Prado followed with his first homer since April 29.
Delgado, recalled from Triple-A earlier Tuesday, gave up two runs on eight hits and struck out six in seven innings.
NOTES: Prado's home run was his first in 167 at-bats spanning 44 games. ... To make room for Eovaldi, the Marlins optioned LHP Edgar Olmos to Double-A Jacksonville. ... The Diamondbacks optioned RHP Charles Brewer to Triple-A Tucson to make room for Delgado. ... It was Delgado's 25th career start and first with Arizona. The right-hander came to the Diamondbacks in January in a trade that also brought Prado to Arizona for Justin Upton. ... Delgado had pitched once before for Arizona this season, allowing two runs on four hits in two innings after being recalled when RHP Brandon McCarthy was placed on the 15-day disabled list. ... McCarthy, on the 15-day DL with right shoulder inflammation, threw on flat ground from 105 feet on Tuesday. ... Diamondbacks RHP Trevor Cahill will try to snap a three-game losing streak Wednesday afternoon when he faces RHP Jose Fernandez and the Marlins.