PHILADELPHIA -- Giants closer Sergio Romo took a deep breath and smiled after explaining his escape act at the end of a 2-1 win over the Philadelphia Phillies on Thursday.

"I'm pretty fortunate," he said. "I don't want to do that again."

After the Giants scored two runs off Phillies closer Jonathan Papelbon in the top of the ninth, Romo loaded the bases with no outs in the bottom of the inning but managed to finesse his way to a 25th save. The win was the second in a row for the Giants and clinched a second straight series victory on the road.

The ninth-inning rally robbed Phillies starter Cole Hamels of a win but allowed Matt Cain to walk away with his seventh after eight strong innings.

PHILADELPHIA, PA - AUGST 1: Closer Sergio Romo #54 of the San Francisco Giants slips and falls after attempting to field a ball hit by Cody Asche #25 the
PHILADELPHIA, PA - AUGST 1: Closer Sergio Romo #54 of the San Francisco Giants slips and falls after attempting to field a ball hit by Cody Asche #25 the Philadelphia Phillies during the ninth inning in a MLB baseball game on August 1, 2013 at Citizens Bank Park in Philadelphia, Pennsylvania. The Giants defeated the Phillies 2-1. (Photo by Rich Schultz/Getty Images) ( Rich Schultz )

"You saw two guys at the top of their games," Giants manager Bruce Bochy said. "It was a classic matchup. I enjoyed it, but it got a little too entertaining in the ninth, to be honest."

Hamels had been dominant through the eighth, but as soon as he was out of the game the Giants pounced. Hunter Pence hit a leadoff single against Papelbon, and Brett Pill sent Pence to third with a hit to right. In his second big league game and first career pinch-hit appearance, rookie Roger Kieschnick singled to right to tie the game.

"He has great composure out there," Bochy said. "He doesn't seem in awe of anything."

Joaquin Arias followed with a single that scored Pill, but the Giants failed to tack on. Ordinarily, that wouldn't be an issue for Romo. But the All-Star found trouble right away. Delmon Young reached on an error by Arias, and Romo slipped and failed to get a throw off after fielding Cody Asche's bunt. Romo then hit John Mayberry Jr., loading the bases. Bochy thought about going out to the mound to calm his closer but instead stood on the top step.

"He's such a tough kid," Bochy said. "That's his game. That's why he's our closer. That's your guy. That's as ugly a rally as I've seen, but you've got to keep the faith that he's going to find a way."

The Giants played the infield back, conceding the tying run, and Romo said he was hoping just to limit the damage. After Laynce Nix hit a shallow fly ball to right, Romo started thinking about getting two game-ending outs with one pitch. Instead he got another shallow fly, this time to left by Carlos Ruiz. With two outs, Romo got pinch-hitter Erik Kratz to ground out.

Romo's save clinched a win for Cain, who looked headed for another hard-luck loss. He retired the first 11 hitters and gave up his lone run in the fifth, when Hamels lined a hanging curveball into left field with two runners on. Since lasting just two-thirds of an inning on July 10, Cain has given up just four earned runs in three starts.

"I'm just trying to throw good strikes," Cain said. "I'm trying to make the game a little simpler."

The defense made the comeback attempt simpler with two strong plays in the late innings. Jeff Francoeur, who is hitting just .167, saved a run in the seventh when he threw out pinch-runner Michael Martinez at the plate on a single to left.

PHILADELPHIA, PA - AUGST 1: Cole Hamels #35 of the Philadelphia Phillies gets picked off first base and is tagged out by first baseman Brett Pill #6 of the
PHILADELPHIA, PA - AUGST 1: Cole Hamels #35 of the Philadelphia Phillies gets picked off first base and is tagged out by first baseman Brett Pill #6 of the San Francisco Giants during the fifth inning in a MLB baseball game on August 1, 2013 at Citizens Bank Park in Philadelphia, Pennsylvania. (Photo by Rich Schultz/Getty Images) ( Rich Schultz )

"I know I'm going to figure it out at the plate," Francoeur said. "But my dad always said one thing you do is hustle and play good defense. Just because you're not hitting, you can do other stuff."

Arias, playing shortstop, cut down another runner at the plate in the eighth, allowing the Giants to go into the ninth needing just a run to tie.

"That right there changes the game with the way Cole and I were going back and forth," Cain said. "Runs were scarce in this game. That made a big difference."

  • The Giants have not named a starter for the final game of this six-game trip, and all indications are that it will be someone other than Barry Zito, who originally had been slated to pitch the first and last games of the trip. Bochy said he would make an announcement Friday, although he eliminated a couple candidates before Thursday's game. Ryan Vogelsong will make one more start for Double-A Richmond, and left-hander Mike Kickham will remain with Triple-A Fresno despite taking a no-hitter into the seventh inning on Wednesday night.

    Zito is 0-7 with a 9.97 ERA in nine road starts. If he is pulled from the rotation, recently acquired right-hander Guillermo Moscoso likely will make the start Sunday against the Tampa Bay Rays.

    For more on the Giants, see Alex Pavlovic's Giants Extra blog at blogs.mercurynews.com/Giants. Follow him on Twitter at twitter.com/AlexPavlovic.