SAN DIEGO -- Arizona broke a 2-2 tie with an unearned run in the top of the ninth then saw closer Brad Ziegler get a game-ending double play to work out of a bases-loaded jam in the bottom of the inning to defeat the Padres 3-2 Friday night at Petco Park.
The loss was the Padres' fourth straight and dropped them into sole possession of last place in the National League West -- although they did score their first runs of the season at Petco Park after being shut out by the Dodgers in each of their first three home games of the season.
"A defensive miscue caused it to unwind for us," said Padres manager Andy Green, who lost his first meeting against the Diamondbacks. Green was Arizona's third-base coach last season.
Nothing about the ninth inning went right for the Padres, who are 0-4 at home this season.
With the Padres in their standard defensive shift against a left-handed hitter, Arizona third baseman Jake Lamb opened the ninth with an infield single to the left side off Padres closer Fernando Rodney.
Shortstop Alexei Ramirez, the only infielder on the left side, went to his right and gloved the ball but had no play on Lamb.
After left fielder Yasmany Tomas popped out, Lamb stole second with pinch-hitter Phil Gosselin at the plate and advanced to third when Padres catcher Derek Norris threw wildly into center field -- the throw being made while the catcher was still on his knees.
Gosselin then topped the ball up the first baseline, Lamb easily beating first baseman Wil Myers' throw to the plate as Gosselin reached on an infield single.
The situation worsened for the Padres in the bottom of the ninth.
Second baseman Cory Spangenberg and Ramirez opened with back-to-back singles off Ziegler to put runners at first and third with no one out. After a failed squeeze bunt by Alexi Amarista, Ziegler struck out the third baseman -- although Ramirez stole second on the strikeout pitch.
Ziegler then walked pinch-hitter Brett Wallace to load the bases before getting lead-off hitter Jon Jay to ground into a game-ending double play. Jay is hitless in his last 14 at-bats for a Padres team that had been shut out a major league-record five times in its first 10 games.
"I tried to just keep focused because I knew with the defense I had behind me, all I had to do was get the ball on the ground," said Ziegler, who extended his franchise record with his 30th straight save and second of the season.
"The strikeout was big just to put us in position for the double play," continued Ziegler. "Two of the first three pitches I threw were probably the worst pitches I threw this season. I came back with some of the best pitches I've thrown."
Greinke had held the Padres to two runs on five hits and one walk before yielding a one-out double to Padres first baseman Wil Myers in the eighth. Shields departed after seven innings, giving up two runs on six hits and four walks.
Greinke entered the game with a 6-1 career record against the Padres with a 1.56 earned run average. But he had struggled in each of his first two starts -- surrendering 11 runs on 16 hits in 10 innings -- and fell behind Friday night.
Arizona scored first when catcher Welington Castillo opened the second inning with a 363-foot home run into the left-field seats off Shields. The homer, on a 1-and-1 pitch, was the fourth allowed by Shields in a span of nine innings. He tied for the National League lead with 33 homers allowed last season.
The Padres tied the game in the bottom of the second and took the lead in the fourth. Both times it was the bottom of the order that came through for the Padres' struggling offense.
Left fielder Melvin Upton Jr. opened the second with a single, moved to second on a ground out and stole third on appeal after originally being called out by third base umpire Laz Diaz.
Upton, however, did not score the tying run.
He was tagged out in a run down between third and home on Spangenberg's grounder to Arizona first baseman Paul Goldschmidt. The run down allowed Spangenberg to reach second and the second baseman scored on Ramirez's single to left.
The run was the first scored by the Padres at home this season -- and only their second in a span of 30 innings. They were shut out a major league-record three straight times by the Dodgers in the season-opening series at Petco Park and scored only one run in their previous three games in Philadelphia.
Catcher Derek Norris singled with one out in the fourth, moved to second on Spangenberg's grounder to Goldschmidt and scored on a two-out, opposite-field single to left by Amarista.
"We have to find a way to win games like that," said Shields. "We have to start finding ways."
NOTES: Padres 3B Yangervis Solarte is eligible to come off the disabled list on April 26 and ran in the pool Friday. But Padres manager Andy Green said his return might be slightly delayed to be sure he's 100 percent. ... Padres RHP Tyson Ross (shoulder weakness) is scheduled to start throwing by Monday and might need a rehab start before he returns to the top of the rotation. ... Welington Castillo's homer off James Shields was the 2,999th in Diamondbacks' franchise history. ... This was the first regular-season meeting of Arizona manager Chip Hale and Padres manager Andy Green, who was Hale's third-base coach with the Diamondbacks last season. ... Arizona SS Nick Ahmed hit ninth in the order for the ninth time this season on Friday. He is hitting .345 with two doubles, three homers and six RBIs in the last spot in the order.