SAN DIEGO -- Didi Gregorius picked a good time to deliver his first RBI in three weeks.
The D-backs shortstop tripled down the right-field line to score Chris Owings with what proved to be the game-winning run as the D-backs outlasted the Padres, 2-1, in 12 innings Tuesday night at Petco Park.
"They told me just be ready for the slider and the first slider I swung and missed, but I was waiting for the second one and put a good swing on it and it stayed fair down the line," Gregorius said.
With one out in the 12th, Owings doubled to left just over the outstretched glove of Jesus Guzman. Gregorius then hit a Luke Gregerson slider to right.
With the three extra innings played, the D-backs set a record for most extra innings played in a season with 78. The previous mark of 76 was held by the 1969 Twins. Arizona has played 24 extra-inning games this year and is 17-7 in those contests.
"We've played so many extra-inning games, especially when you get the 'W,' it's fun," Gregorius said.
After scoring runs in bunches the previous five games, the D-backs have managed just two in the first two games of this series, yet that's been good enough to earn a split with two more games remaining.
"This park has just been hard for us to score in all year," D-backs manager Kirk Gibson said. "These guys have had our number, so it feels good to get that win."
Arizona starter Wade Miley allowed four hits and a walk while striking out seven in six scoreless innings.
"Miley has a good arm, no doubt about it," Padres manager Bud Black said. "Miley, he proved it last year as a rookie pitcher. A good live fastball, good change, every now and then mixes in a curveball. He has a quick arm, comes after hitters. He gets after it."
The D-backs would have liked Miley to go deeper into the game, but the Padres made him work for his outs and he was at 107 pitches.
"He fights himself a little bit," Gibson said of Miley. "He gets mad at himself."
Padres starter Tyson Ross was nearly as good as Miley, except for a sixth-inning fastball that he left up to Paul Goldschmidt.
Goldschmidt, who continues to bolster his case for the National League Most Valuable Player Award, blasted the 0-2 offering into the seats in right-center to give the D-backs a 1-0 lead on his 36th blast.
"It was a fastball that I wanted off the plate, but he's a good hitter and he put a good swing on it," Ross said.
It looked for a while like that might be all the offense the D-backs would need for a victory as Will Harris came on and pitched a scoreless seventh
In the eighth, though, the Padres put together a rally against right-hander David Hernandez.
Pinch-hitter Mark Kotsay led off the inning with a single and Reymond Fuentes pinch-ran for him and moved to second when Chris Denorfia blooped a single to right.
Hernandez then rebounded to retire the next two hitters and the D-backs intentionally walked Chase Headley to fill the bases and bring Tommy Medica to the plate. That's when things got interesting.
Medica appeared to be have been hit by the 2-2 pitch by Hernandez, but home-plate umpire Alan Porter ruled that it did not hit him.
Later in the at-bat, catcher Miguel Montero could not catch a Hernandez breaking pitch and it scooted by him and allowed Fuentes to score the tying run.
Once the D-backs took the lead in the 12th, they turned the ball over closer Brad Ziegler, who retired the Padres in order to record his 12th save of the year.
The 12 saves are a career-high for Ziegler, who saved 11 for the A's in 2008.
Ziegler was thrust into the closer's role due to injury and ineffectiveness by fellow relievers J.J. Putz, Heath Bell and Hernandez.
"In a way, it's kind of bittersweet," Ziegler said of the save total. "Because I know if everybody had been lights out, healthy, pitching the way they're capable of, I probably wouldn't have any or maybe one. If that's the role they felt like I could help this team help the most at this moment, then I'm more than willing to give it a shot and it's fun, I enjoy closing. But I know it's also probably not the ideal role for me."
Steve Gilbert is a reporter for MLB.com. Read his blog, Inside the D-backs, and follow him on Twitter @SteveGilbertMLB. This story was not subject to the approval of Major League Baseball or its clubs.