SAN FRANCISCO (AP) - Evan Longoria hit a go-ahead, two-run double in the seventh inning and made a stellar defensive play in the ninth, and the San Francisco Giants rallied to beat the San Diego Padres 6-5 on Tuesday night.
Joe Panik singled twice and Pablo Sandoval added a sacrifice fly for the Giants. Steven Duggar hit a home run, his first since mid-April.
Fernando Tatis Jr. homered on the first pitch of the game and drove in two for San Diego. Ian Kinsler also went deep.
The Giants entered the day with the second-worst home record in the majors at 11-20 and trailed 4-3 before scoring three times off the Padres bullpen.
Pinch-hitter Brandon Belt drew a leadoff walk against Trey Wingenter (0-1) and went to third on Panik's single. After Mike Yastrzemski flew out, Longoria lined a 1-1 pitch past left fielder Wil Myers. Belt scored and Panik slid in safely to beat the throw home from Tatis. Sandoval hit a sac fly that scored Longoria.
Mark Melancon (3-1) retired three batters to win. Will Smith pitched a 1-2-3 ninth for his 15th save in 15 tries. Longoria backed Smith with a leaping grab on Manuel Margot's hard liner for the second out of the inning.
The Giants overcame a wacky play in the fifth when they missed three chances to record the final out of the inning on the same play with the bases loaded.
Eric Hosmer hit a sharp comebacker off reliever Trevor Gott that knocked Gott's glove off his hand. The right-hander quickly retrieved the ball, but his throw to first was late and wide and pulled Sandoval off the bag as Chris Paddack scored. Tatis, who drove in the first run of the inning with an infield single, rounded third then made a headfirst slide into home to beat Sandoval's throw. Giants catcher Stephen Vogt threw to third but not in time to get Manny Machado.
Hosmer was credited with two RBIs on the play, giving him a team-leading 38.