The Padres invested a great deal in the future of their offense Monday afternoon. Yet even as their immediate needs continue to fall by the wayside – specifically with runners in scoring position – patience and aggressive paid dividends Monday night.

Hours after inking Jedd Gyorko to a six-year, $35 million extension, three walks, a wild pitch and an error in the eighth inning bought the Padres a 5-4 win, which Huston Street closed out with a perfect ninth inning in front of the remnants of a crowd of 14,784 at Petco Park.

“We kind of stole one,” Padres first baseman Yonder Alonso said. “ … We battled back. We were down 4-0, made two errors, and we found a way to bounce back, score some runs and chip away and force them into a pressure situation.

“Today, they couldn’t do it and we were able to get the upper hand.”

Stole one because the Padres again struggled with runners in scoring position, this time going 2-for-9 to add to an NL-worst .161 average (18-for-112) in that department.

Stole one because they hit into three more double plays, including another from Chase Headley, now tied for the major league-lead with five.

Stole one because, trailing 4-3 to start the eighth, they rallied without a single hit.

Left-hander Rex Brothers walked the first two batters he faced – Xavier Nady and Seth Smith – before retiring Gyorko and Headley on a pair of fly balls to center, the start of what looked like yet another wasted opportunity.