SAN FRANCISCO — The San Francisco Giants played at Oracle Park and lost on a walk-off home run on Friday.

That’s not a misprint, that’s the type of cruel, unusual punishment the Giants were subjected to in Game 2 of a doubleheader on Friday against the San Diego Padres.

With right-hander Sam Coonrod on the mound attempting to close out the team’s second win of the day, Padres center fielder Trent Grisham stepped to the plate and yanked a three-run home run into the right field arcade at Oracle Park to lead San Diego to a 6-5 win and drop the Giants back to .500 in a game that could have brought San Francisco within inches of a postseason berth.

“This sucked,” manager Gabe Kapler said. “It was a gut-punch loss.”

After the Giants and Padres had two games postponed in San Diego in mid-September due to a false-positive test for COVID-19, the teams were required to make up a game in a Friday doubleheader in San Francisco during the final weekend of the season.

The Giants survived a three-run seventh-inning rally from the Padres to secure Game 1 in a 5-4 victory, but couldn’t overcome a three-run rally from the Padres in the final frame of Game 2. Of course, they never had the chance to counter because they were designated as the road team, so when Grisham homered in the bottom of the seventh inning, the Giants stood stunned, in silence, watching the Padres celebrate at home plate.

After entering with a 3-2 lead and giving up a pair of runs in Thursday’s 11-inning loss to the Rockies, Coonrod returned to the mound seeking a save that would have reduced the Giants’ magic number to one with two days left in the season. The right-hander was trying to protect a two-run lead, but after giving up an infield hit and a walk, Coonrod appeared to be tentative as he approached Grisham.

With the bullpen depleted from significant usage this week, Kapler said Coonrod would have faced at least one more hitter before the Giants would have turned the game over to left-hander Wandy Peralta.

After winning the first of two matchups on Friday and watching the 28-30 Brewers and 28-30 Phillies each lose a game, the Giants guaranteed they would finish the day clinging to the second card spot behind the 30-28 Cincinnati Reds. At 29-29, the Giants will wake up Saturday leading Milwaukee and Philadelphia by 1.0 game in the standings, so all San Francisco would need to secure a playoff spot is one additional win and more more loss from each of its closest challengers.

A jumbled NL wild card race has seemed destined to come down to the final day of the season for weeks now and with the Giants unable to sweep the Padres on Friday, the playoff chase continues to head in that direction.

The Giants have known for several days how difficult Game 2 would be as the Padres lined up Cy Young candidate Dinelson Lamet to face them early in the week. After exhausting his bullpen in Thursday’s loss to the Rockies, Kapler and president of baseball operations Farhan Zaidi determined their best choice to start the evening game was veteran right-hander Jeff Samardzija.

After missing the last seven weeks due to right shoulder inflammation, Samardzija returned from the injured list in what will likely be his final appearance in a Giants uniform. The veteran starter missed the majority of the 2018 and 2020 seasons with a shoulder issue and is coming to the end of a disappointing tenure in San Francisco, but was granted one final opportunity at redemption.

With an opportunity to push the Giants toward a playoff berth, Samardzija opened the game with two perfect innings before allowing three runs in a forgettable third inning that put the club in a hole it never climbed out of.

Padres shortstop and NL MVP candidate Fernando Tatis, Jr. authored the defining portion of Samardzija’s comeback story as he blasted a 458-foot home run into the left center field bleachers to give San Diego a 3-1 lead.

“It’s not easy watching these guys grind and go through all the tough parts of the season and pick up innings here and there and you’re not helping,” Samardzija said. “It was just great to see these guys fight all year.”

Pinned against the ropes once more, the Giants must show they have the ability to fight back from another punch that has put their playoff hopes in jeopardy.