At first Nick Hundley thought his drive to left field in the sixth inning Monday night was going foul.

“I gave it an extra look hoping” Hundley said after his tie-breaking two-out three-run homer gave the Padres a 4-1 win over the Arizona Diamondbacks before an announced turnout of 15869 at Petco Park.

“I thought at first it was going to be foul. There was a lot of praying. It stayed fair."

By two feet.

Hundley’s blast had plenty of distance. The 368-foot drive off a 0-and-1 hanging curve thrown by Brandon McCarthy (“It was a bad pitch in a bad situation” said the pitcher) landed on the second balcony of the Western Metal Supply Co. building.

But it was hooking toward the foul pole as it hit the balcony at the rail adjacent to the foul pole.

Hundley’s career-best 12th homer of the season gave Eric Stults his 10th win of the season.

Chase Headley and Tommy Medica were aboard with their second singles of the night when Hundley homered to break a 1-1 tie.

The Padres 73rd win of the season strengthened their hold on third place in the National League West with six games to play. They lead the Giants by a game and the Colorado Rockies by 2 ½ games.

Stults allowed one run on seven hits and two walks over 6 1/3 innings and picked up his second straight win following a six-decision losing streak.

“That’s a good number for a pitcher and great for Eric” said Padres manager Bud Black of Stults’ 10th win. “He’s been consistent for us since the first day of spring training.”