"It's nice to get over the hump," Stults said. "My last three starts, I've found my rhythm."
It was the second straight win for Stults (10-13) after breaking a 10-game winless streak. He dropped his first six second-half decisions before prevailing in his previous outing against the Pittsburgh Pirates.
"After the All-Star break I wasn't pitching like I wanted to," Stults said. "So I decided to just take it one start at a time and give us a quality game and try to give us a chance to win."
Huston Street worked the ninth for his 33rd save in 34 chances.
Stults struck out five and walked two in winning consecutive starts for the first time since July 9 and July 14.
"That was indicative of a lot of the games we've seen Stults pitch here the last couple of years," Padres Manager Bud Black said.
Hundley has four homers, five doubles and 16 RBIs in his last 30 games.
The win was the Padres' sixth in seven games against the Diamondbacks at Petco Park.
The Padres had runners on in the second, fourth and fifth innings with none getting in scoring position. That changed in the sixth when Chase Headley notched his second hit and it was followed by Tommy Medica's single.
Hundley smacked a 77 mph curveball from Brandon McCarthy (5-10) which landed just inside the left-field foul pole on the Western Metal Supply Co., building's second deck. It extended Hundley's career highs to 12 home runs and 43 RBIs.
"It's 0-1 and I'm throwing a breaking ball there to try and set up something else," McCarthy said. "It's a bad pitch."
Hundley wasn't sure if Monday's homer would stay fair. He gave it plenty a body English and then some.
"A lot of prayers," he said. "Really anything that would help because I wasn't sure. About halfway down the line I thought it was foul and was hoping it would go fair, and it did."
Arizona chased Stults with one out in the seventh on Cliff Pennington's double and a walk to Adam Eaton. Nick Vincent then got A.J. Pollock to pop up to Headley at third and struck out Paul Goldschmidt on three fastballs.
"The huge at-bat was Goldschmidt," Black said. "He got a couple of fastballs by him and then a hard cutter. He didn't pick it up out of his hand and had kind of a funky swing on it."
The Padres, after being shut out the previous two games by the Los Angeles Dodgers, snapped a 21-inning scoreless string in the first inning.
Leadoff hitter Chris Denorfia singled and advanced to second on a groundout. Headley's single made it 1-0.
Arizona tied the score in the second on Eaton's fielder choice, which followed singles by Matt Davidson, Will Nieves and Pennington, with Davidson scoring. But the Diamondbacks let a big chance slip away.
"He's throwing the ball well here," Arizona manager Kirk Gibson said. "He threw a big game. We had some opportunities. The guys got frustrated and he was throwing the ball where he wanted to throw it. We had some lost opportunities."
Black said Cedeno was woozy and had a headache, but was not being hospitalized for an evaluation.
Black said RHP Andrew Cashner (10-9) won't pitch again this season. Cashner, a converted reliever, has thrown 175 innings and Black said the team will skip his next turn, Saturday in San Francisco. ... Padres OF Will Venable was out of the lineup with an abdominal strain. ... Goldschmidt extended his hitting streak to 13 games with a first-inning double. ... Arizona LHP Wade Miley makes his career-high 32nd start on Tuesday in the second game of the series. ... Arizona RHP Patrick Corbin's final start of the season is this weekend against Washington. Corbin (14-7) has struggled lately, including Sunday's outing against Colorado when he allowed four runs and 10 hits in 4 1/3 innings.