In that inning, Shields (9-5) committed the cardinal sin; walking the leadoff hitter, A.J. Pierzynski. Adonis Garcia followed with a single before Jace Peterson lined a single to center field in a game the Padres led, 2-0.
Facing the No. 7 hitter in the order, Joey Terdoslavich, Shields got him to go after a changeup for a strikeout on the seventh pitch of the at-bat. Andrelton Simmons then got out in front of a slider, turning it into a 6-4-3 double play.
"The bottom line is I got myself in that situation by walking the leadoff hitter. I've got to do my job and get out of that situation," Shields said. "That's our job as pitchers; minimize damage."
In the sixth inning, his final inning of work, Shields gave up a one-out single, again to Pierzynski, and then got Garcia to bounce into another 6-4-3 double play to end the inning.
"That's a momentum-changer," said Padres interim manager Pat Murphy of the double-play balls. "Those double plays were really key."
Shields allowed six hits and two walks over six innings with seven strikeouts. This was his second victory at Petco Park since June 3.
Statistically, this was Shields' best outing since allowed one unearned run during a start in Pittsburgh on July 6.
"I was locating my two-seamer today, being aggressive for the most part," Shields said. "That strikeout [of Terdoslavich] with the bases loaded with no outs was big. I have been a ground-ball pitcher, for the most part, all year long. I felt comfortable getting a ground ball, and the defense did a great job."
After Shields left, the Padres scored five runs in the bottom of the sixth inning -- with Upton Jr. hitting the first of his first two home runs to go with a season-high five RBIs. Yangervis Solarte also added a three-run home run in the inning.
Corey Brock is a reporter for MLB.com. Keep track of @FollowThePadres on Twitter and listen to his podcast. This story was not subject to the approval of Major League Baseball or its clubs.