SAN DIEGO _ There was a giant cake in the Padres clubhouse Saturday afternoon to celebrate Austin Hedges' 26th birthday.
In the fifth inning, the Padres catcher gave his team its first lead of the week with an RBI single.
It was Christian Villanueva who provided the icing on Saturday night's 7-6 victory _ and was then doused by ice water on the grass just beyond the infield _ after he laced a pinch-hit walk-off single to left field to score Travis Jankowski from second base.
The Diamondbacks, who just kept stringing together hits, tied the game in the seventh inning, and the teams an out away from heading to extra innings.
The victory came after the Padres made a fight of it despite another starting pitcher shoveling dirt on their chances early.
For the fourth straight game, Padres come to bat in the first inning already trailing.
They caught up with successive three-run innings, fell behind, took a lead and were tied again before Villanueva's heroics.
Padres manager Andy Green had hoped for "length" from starting pitcher Clayton Richard to help spell the Padres "beat up" bullpen. It was at least a decent bet Richard would be able to provide that length, as he had nine times gone at least seven innings this season, including when he scattered four hits and two runs over eighth innings five days earlier against the Angels.
Green then chose to lift Richard for a pinch-hitter after the lefty had allowed five runs in five innings, and one of the rested relievers gave up the lead Hedges had provided on the night the franchise honored the best of all its relievers by unveiling a statue of Trevor Hoffman just beyond the bullpens at Petco Park.
With back-to-back doubles by Eduardo Escobar and A.J. Pollock and a single by Paul Goldschmidt, the Diamondbacks took a 2-0 lead.
It was 3-0 after another run on three singles in the third.
The Padres got all those runs back in the fifth. Walks by Eric Hosmer and Cory Spangenberg around Hunter Renfroe's single loaded the bases with no outs. After Austin Hedges struck out, Freddy Galvis bounced a ball into center field that scored two and got Spangenberg to third base. Manuel Margot's sacrifice fly scored Spangenberg.
Again, Richard labored to get outs in the fifth, as the Diamondbacks strung together three singles and Paul Goldschmidt's double to take a 5-3 lead.
The Padres responded with another three-run inning.
Travis Jankowski singled to left, went to second on Wil Myers' dribbling infield single and scored on a double to the left field wall by Hosmer. Spangenberg's single drove in Myers and put Hosmer on third before Hedges' single.
The inning ended with Manuel Margot fouling out and Franmil Reyes, pinch-hitting for Richard, grounding out.
Jose Castillo and Miguel Diaz had thrown 43 and 32 pitches, respectively, the night before and Robert Stock had pitched two straight days, so all three were unavailable Saturday.
That left five arms to cover what the Padres hoped would be just four innings.
Phil Maton replaced Richard and got through a scoreless sixth inning before A.J. Pollock hit a two-out double and scored on a single by Goldschmidt, his fourth hit of the night, in the seventh.
Craig Stammen (6-2) pitched a perfect eighth and ninth.
The Padres went down in order the next three innings.
The top of their order greeted Diamondbacks left-hander Andrew Chafin in the ninth.
Jankowski worked a walk and, after Wil Myers hit a fly ball to left field for the first out, went to second base on Hosmer's grounder to first.
That brought Renfroe to the plate for the Padres and right-hander Yoshihisa Hirano into the game for Arizona. The first batter Hirano faced, though, would be pinch-hitter Christian Villanueva after Renfroe was intentionally walked.
Villanueva, who had been hit in his left foot by a pitch and left Friday's game in the eighth inning, having also fouled two pitches off the same foot over the previous two days, swung through a split-finger fastball and fouled off two more before watching a fastball sail high and then reaching out to smack a splitter in the bottom of the zone.