SAN FRANCISCO (AP) — Clint Barmes hit a two-out RBI double in the 11th inning and the Colorado Rockies won their season-high fourth straight road game by beating the San Francisco Giants 2-1 Tuesday night.

The Rockies had runners thrown out at the plate in the ninth and 10th innings before finally breaking through in the 11th.

Santiago Casilla (1-1) retired the first two batters before allowing a single to Miguel Olivo and walking Melvin Mora. Barmes then lined a double just inside the left-field line that scored Olivo with the go-ahead run.

Rafael Betancourt (1-1) struck out two in a perfect 10th for the win. Manuel Corpas got three outs for his fifth save in six chances.

Colorado missed good chances to score the go-ahead run in both the ninth and 10th innings. With runners on first and second and two outs in the ninth, Mora lined a two-out single to right. Andres Torres charged and fielded the ball on one bounce. He threw a three-hopper to the plate and Bengie Molina slapped the tag on pinch-runner Johnny Herrera just before he touched home plate to preserve the tie.

Then with runners on first and third and no outs in the 10th, Brian Wilson got Carlos Gonzalez to ground out to third with Barmes holding. Then with runners on first and second, Ryan Spilborghs grounded to third baseman Pablo Sandoval, who easily threw out Barmes at the plate.

The Rockies tied the game at 1 in the seventh when Miguel Olivo singled with one out and went to third on a double by Mora. Barmes followed with a sacrifice fly, but Colorado almost didn't get a run out of it when Aaron Rowand threw out Mora at third base. Olivo crossed home plate just before Sandoval tagged out Mora and plate umpire Ed Rapuano emphatically signaled that the run counted.

That was the only run Colorado scored off Barry Zito, who didn't allow a runner to get into scoring position until Spilborghs' one-out double in the sixth inning. Zito allowed one run and four hits in seven innings, striking out eight.

Jason Hammel retired the first nine batters he faced before San Francisco broke through for the first time this series. Torres led off the fourth inning with a drive to right field that bounced into McCovey Cove to give the Giants a 1-0 lead. San Francisco threatened later in the fourth and again in the fifth but was unable to add anything else against Hammel.

He was helped out by a nifty double play turned by Barmes in the seventh. With Buster Posey running from first, Molina hit a grounder up the middle. Barmes fielded it while moving to cover second and tagged out Posey as he slid into the base before throwing out Molina at first.

Hammel allowed one run, seven hits and no walks in 6 2-3 innings, striking out five.

NOTES: Colorado C Olivo cut his right thumb trying to block a pitch in the fifth inning. He had to have it retaped before the bottom of the sixth to make sure no blood got on the baseball. ... Giants OF Mark DeRosa cut short his rehab assignment at Class-A San Jose saying his left wrist still didn't feel right. He will take a few days off before joining Triple-A Fresno this weekend. ... San Francisco LHP Jeremy Affeldt (left hamstring) was unavailable to pitch. Manager Bruce Bochy said if Affeldt couldn't go Wednesday the team would consider putting him on the DL.