PHOENIX - Paul Goldschmidt had a pretty good idea that he'd just won the game for the Arizona Diamondbacks.
Goldschmidt hit a leadoff home run in the bottom of the ninth inning Tuesday and the Diamondbacks ended a four-game losing streak, beating the Miami Marlins 3-2 .
"I had a good feeling it was going out," Goldschmidt said. "If not, it wasn't going to be a triple. I wasn't running that hard. I'm glad it got out of here."
Goldschmidt's home run bounced high off the batter's backdrop in deep center field. His 17th homer of the season was his second in as many nights, and the second game-ending home run of his career.
"I just said to Penny (infielder Cliff Pennington), 'Let's have another Goldy party,' and then he hit it," Arizona manager Kirk Gibson said. "You always think that way."
Martin Prado also hom-ered for the Diamondbacks, who snapped a season-high four-game losing streak.
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.
"Any time it's a walk-off, whether it's you or one of the other guys, it's fun," Goldschmidt said.
Nathan Eovaldi, activated from the disabled list and making his first start since Sept. 30, scattered three hits over six innings for the Marlins, who had won two in a row.
The Marlins took a 2-0 lead in the fourth against Randall Delgado. Derek Dietrich hit an RBI triple and scored on Adeiny Hecha-varria'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.
"I was just looking for a fastball and to put a good swing on it," Prado said. "He tried to come in, and I knew I was ready for the fastball and it went out."
Delgado, recalled from Triple-A earlier Tuesday, gave up two runs on eight hits and struck out six in seven innings.
"When he came up and threw last time he wasn't as aggressive as he could be," Gibson said. "But you could see he shortened his motion and focused on locating the ball more. I think in spring training we were looking at a guy who was more of a thrower."
• First-round draft pick Braden Shipley has signed a $2.25 million contract with the Arizona Diamondbacks.
The 6-foot-3, 195-pound right-hander, who played collegiately at Nevada, was the 15th selection overall. He was projected to go much higher.
Shipley's fastball regularly is in the mid-90s and has hit as high as 97 to 98 mph. He is expected to join the Hillsboro Hops of the Class A Northwest League this week.
• Who: Marlins at D-backs
• When: 12:40 p.m.
• TV: None
• Radio: 1490-AM