CINCINNATI -- Angel Pagan made the Giants' long trip home a little easier.
"We were all pumped when I got back to the bench," Pagan said. "We were thinking about a happy flight home."
The Giants avoided a three-game sweep and snapped a seven-game losing streak at Great American Ball Park.
"It was one of those games that save your sanity," Giants manager Bruce Bochy said.
Joaquin Arias, who was called up Wednesday when Aubrey Huff was placed on the disabled list with an anxiety disorder, led off the ninth against Cincinnati closer Sean Marshall (0-2) with a walk, and Ryan Theriot followed with a single. After pinch-hitter Brett Pill struck out, Pagan lofted a 1-2 pitch 386 feet into the left field seats.
Pagan was ready for the curveball after striking out against Marshall on the pitch Wednesday night.
"I knew he was going to throw it again," Pagan said. "I had to make an adjustment. I swung at one in the dirt last night. This one was in the strike zone."
"The curveball's been a good pitch for me," said Marshall, who blew his first save after converting four opportunities. "I've gotten some outs with it. The ball hung in the middle of the plate. He didn't get a good swing on it. What hurts is the guys played so well."
Casilla is replacing Brian Wilson, who will miss the rest of the season with an elbow injury.
"You have to throw strikes. That's number one," Casilla said. "Having six saves last year helped and I pitched the ninth inning in the Dominican. When I pitch more I feel better."
Casilla bailed out a bullpen that had a rough series.
"You can't throw the ball any better than Casilla did," Bochy said. "Our bullpen has been struggling this series, too. We haven't played our best baseball yet."
Giants third baseman Pablo Sandoval went 1 for 5, extending his season-opening hitting streak to 19 games, a franchise record. He went into the game tied with Johnny Rucker, who hit in the first 18 games of the 1945 season with the then-New York Giants.
Reds starter Homer Bailey lasted 6 1/3 innings, allowing seven hits and three runs -- two earned -- with two walks and six strikeouts.
Giants starter Ryan Vogelsong gave up seven hits and four runs with two walks and five strikeouts in six innings.
The Reds took a 2-0 lead in the second on Devin Mesoraco's sacrifice fly and Bailey's RBI single. The Giants capitalized on shortstop Zack Cozart's error to tie the score with two runs in the fourth inning.
Bruce broke the tie with his fourth homer of the season, a 381-foot shot to right-center field that just cleared the glove of the leaping Pagan. The homer was Bruce's first since hitting two against the Miami Marlins on April 8.
Pinch-hitter Gregor Blanco came up with a sacrifice fly to cut Cincinnati's lead to 4-3 in the seventh before Rolen's 429-foot homer.
Marshall's appearance was the 300th of his career. ... The Giants hadn't won in Cincinnati since a 3-0 win on June 8, 2010. ... Pagan extended his hitting streak to 11 games (16 for 52, .308) with a seventh-inning single. ... Giants C Buster Posey went 0 for 3 with a walk to see his hitting streak snapped at eight games. ... San Francisco RF Nate Schierholtz went 0 for 4 to extend his streak of consecutive hitless at bats to 12.
Cal Raleigh demolishes 1st career HR, Mariners go back-to-back
Cal Raleigh sends his first big league home run 444 feet as the Mariners hit back-to-back dingers in the second inning of a 4-3 win over the A's.
Reynolds HR, Pirates stop 4-game skid, beat Giants 6-4
— Bryan Reynolds homered, Adam Frazier drew a bases-loaded walk to force in the go-ahead run in the seventh inning when Pittsburgh scored three times without a hit, and the Pirates beat the San Francisco Giants 6-4 on Friday night.
Giants fans have intense kayak race over home run ball
Steven Duggar belts a solo homer into McCovey Cove, and a pair of Giants fans race to retrieve it.
Bryan Reynolds smashes a 2-run HR in Pirates' win
Bryan Reynolds hits a home run to right field as the Pirates beat the Giants 6-3 at Oracle Park.
On this date: Varitek and A-Rod incite benches-clearing brawl
On July 24, 2004, the bitter Yankees-Red Sox rivalry reached a new level when Boston catcher Jason Varitek shoved New York slugger Alex Rodriguez in the face with his mitt, leading to a benches-clearing brawl.
Astros hand Rangers 10th straight loss with 7-3 victory
— Kyle Tucker hit a three-run homer in Houston’s big third inning to help the Astros hand the Texas Rangers their 10th straight loss with a 7-3 victory on Friday night.