The win gave the Giants a 5-2 record in the homestand, including a series split against the Reds.
After Posey reached on a two-out ground-rule double and Pablo Sandoval was intentionally walked, Pagan sent a towering fly ball off Reds reliever Jose Arrendondo floating towards the right-field wall. Bruce eyed the ball the entire way but was positioned too shallow, and the ball went past a leaping Bruce's glove to end the game.
"It's embarrassing," Bruce said. "It's a really, really tough way to lose. We battled back and worked our butts off to get back and that happens. It's a tough one to swallow."
Pagan's walk-off hit came after the Giants' bullpen squandered a one-run lead earlier in the inning. The Reds opened the ninth inning with four straight singles, including Miguel Cairo's game-tying RBI line drive off closer Santiago Casilla, who entered the inning with one man on.
Casilla proceeded to struck out Ryan Hanigan and Wilson Valdez and got Zack Cozart to line to first to escape the jam.
"I think even the hits he gave up weren't bad pitches," Posey said of Casilla. "He goes as an unsung hero of the game, getting out of there and keeping us in the game."
But the recognized hero of the game was Posey, who found out hours before that he set a National League record with 7.6 million votes in All-Star Game voting. In addition to his ninth-inning double, he also had two RBI singles to give him a team-best 42 RBIs for the season. He hit a go-ahead single to break a 2-2 tie in the seventh to plate Ryan Theriot, who matched a career high with three runs scored.
"He's a great player," manager Bruce Bochy said of Posey. "We needed some timely hits, and he got them for us today."
Posey backed a strong outing from Ryan Vogelsong, who gave up two runs on three hits, striking out five in seven innings. The game marked his 12th straight quality start, as well as his seventh straight start of at least seven innings.
Despite a season-long consistency that has brought him a 2.26 ERA this season, Vogelsong was left off the NL All-Star roster, which was announced before Sunday's game.
Bochy informed Vogelsong before the game that he was left off and said that the decision didn't affect a pitcher who has said has a "maniacal focus" when on the mound.
"He pitches with an edge. That works for him," Bochy said. "He had the same focus that I've seen. That's why I talked to him early; I didn't want him getting the news late. His focus was on the game today and he pitched another great game."
Vogelsong and his "edge" was in the middle of a heated altercation in the sixth when he was trying to sacrifice bunt with Brandon Belt at first. Two pitches from Reds starter Bronson Arroyo that were high and tight did not sit well with Vogelsong, who angrily slammed his bat to the ground and began shouting toward Arroyo as he approached the mound. Both benches cleared, but players returned to their dugouts after a few tense minutes.
"Any of us here are going to get upset -- I would have," Bochy said. "He had enough, and it's human nature. He got upset and the two teams cleared their benches, and that's normally what's going to happen."
Arroyo and Vogelsong were teammates in Pittsburgh in 2001, and Vogelsong said that despite his reaction, he knew Arroyo wasn't intentionally trying to hit him.
"Bronson and I are friends, but when you're on the field and you're between the lines, you're not friends any more," Vogelsong said. "Ball's coming up and in, it's not a comfortable feeling. You don't like it. You're in the heat of battle and things happen like that and you get fired up."
Arroyo apologized to Vogelsong on the field after Vogelsong laid down a sacrifice bunt when play resumed and again in a phone call after the game, saying that Vogelsong had every right to be upset.
"He knows me well enough to know it wasn't intentional," Arroyo said. "I wanted him to hear it out of my mouth. I don't have a problem hitting guys if the situation is right, but those situations weren't on purpose and those weren't the right places to be hitting somebody if you're trying. You can't get up near guys' faces. I don't want to be at the plate trying to lay a couple of bunts down and having somebody buzz my tower."