Hunter Pence, who hasn’t been able to hit much lately, slapped a slider below his knees the other way.

The ball bounced just inside first base and just beyond the reach of a diving Eric Hosmer, rolled into right field and set off a celebration inside AT&T Park on Sunday afternoon.

The walk-off, bases-loaded double off Padres closer Brad Hand in the 11th inning gave the Giants a 3-2 victory.

But Padres manager Andy Green was left to lament that the game was perhaps lost on a choice he made moments earlier, a decision actually precipitated by events from the previous day.

“It’s a hard way to lose a baseball game,” Green said. “Especially as a manager when you make a decision to walk someone and put the winning run on base in that situation, it becomes especially tough.”

Up 2-1 after Cory Spengenberg’s two-out single scored Manuel Margot in the top of the inning, Hand had come on to try for his 21st save.

Even before Andrew McCutchen tagged a belt-high fastball from Hand to the gap in right-center field with one out, what Green knew more than anything is his team could not afford to play a 12th inning.

“You want to leverage every opportunity to win that game and not have a chance to extend,” Green said.

He knew the matchups – that Buster Posey, still a fearsome hitter and with two hits in five career at-bats against Hand, was up and that Hand had succeeded against Brandon Crawford in the past — and against virtually every other left-hander he has faced this season.

Green knew if he looked at his bullpen all he would see is hanging arms and a submarining right-hander who he’d been compelled to promote just that morning.

He was going to win or lose with the pitcher so many Padres victories over the past 13 months.

Jordan Lyles being scratched at the last minute from Saturday’s start due to elbow inflammation forced the Padres to use six relievers to get through that 5-3 loss. With a number of those six having also pitched Friday, the Padres had three fresh arms in the bullpen.

They called up Robert Stock and Kazuhisa Makita Sunday morning, giving them five relievers available for Sunday’s game.

Green had already used four of them, and Makita, with his 6.55 ERA, was around to eat inconsequential innings.

Basically, it was win by Hand, die by Hand.

Said Green: “The context we find ourselves in right there, with the bullpen pretty much done – Brad is our last guy to go to at that point in time – you’re trying to leverage every opportunity to end the game right there and win the baseball game.”

So the call was made to intentionally walk Posey.

“That’s probably the only type of scenario ... where you’re willing to do that and play for the double play or play for the strikeout,” Green said.

Up came Crawford, who had one hit and five strikeouts in 11 career at-bats against Hand.

“You’ve got a lefty-lefty match-up, where Brad has been borderline dominant,” said Green, referring to left-handers’ .068 average in 44 at-bats against Hand this season, including a strikeout by Brandon Belt to start the 11th.

The problem arose when Hand’s trusty slider didn’t slide and instead sailed into the back of Crawford.

That brought up Pence, who was batting .193 entering Sunday’s game, just his sixth start of the month.

After a called strike and a foul ball, Hand spun a slider well below the knees that Pence reached out and slapped the other way.

“I made a pretty decent pitch,” Hand said. “It looked like it was right on the dirt, and he poked something down the line. Tough one. …First pitch to Crawford, hit him with a bad slider. That was a bad pitch. Other than that, I made decent pitches, but they weren’t good enough.”

It was Pence’s first walk-off hit since a ninth-inning double against Hand on May 23, 2016.

Sunday was Hand’s second blown save opportunity in a row. He had given up a game-tying home run in the ninth inning Tuesday against the Oakland A’s, a game the Padres would lose 4-2 in the 10th.

Those are the only blown saves he’s had since April 30.

“It’s really not that bad of an outing,” Green said. “.He gave up a hit to McCutchen, we chose to walk Posey. … He had a slider get away from him. Then somebody fists a ball down the first-base line and wins the game.

In 19 appearances from May 1 through June 13 in St. Louis, when he earned his 21st save with a perfect ninth inning, Hand allowed two runs in 21 2/3 innings. In his three appearances since then, he has given up five runs in a total of three innings. Included in that was a 1-2-3 inning to close out a 6-2 victory on Friday.

“I wouldn’t make much out of it,” Green said. “He was good last time out. … He had a slider get away and he hit a guy. That happens from time to time.”

Before Hand’s unfortunate ending, the Padres again could not have asked for more from their pitchers.

In his six innings to start, rookie Eric Lauer allowed just a solo home run to Gorkys Hernandez. Craig Stammen pitched a perfect seventh and Kirby Yates a scoreless eighth and ninth before Green called on Stock to make his major league debut in the 10th.

Stock got the first batter he faced, Joe Panik, to hit a sharp grounder that bounced up and off the glove of Hosmer, who had been playing back. The ball rolled into right field as Panik ran to second with a double.

Stock struck out Alen Hanson, got Austin Slater on a grounder and then struck out Hernandez.

That, along with Spangenberg’s hit, would have been the story had Hand held on.

And the lack of offense would have been the story had the loss been arrived at differently.

Sunday was the major league-leading 32nd time this season the Padres scored two or fewer runs and the 30th time they lost such a game. It has happened six times in the past 10 games, a stretch in which the Padres have lost eight times. In those 10 games, the Padres have gotten seven quality starts and lost six of them.

“We’re getting great pitching as we continue to grind at-bats, as we continue to grind ways to put runs on the board,” Green said. “That’s been an elusive thing for us.”