Updated

Pablo Sandoval scorched a two-run home run in the bottom of the 10th inning to lift the San Francisco Giants to a 4-2 victory over the Washington Nationals Tuesday in the middle test of a three- game set at AT&T Park.

Marco Scutaro ripped a one-out single back up the middle off Yunesky Maya (0-1) before Sandoval launched the second pitch he saw from the Washington reliever deep into the seats in center field to send the Giants to their second straight win.

Gregor Blanco tied the game with a two-out, two-strike triple that scored Andres Torres in the bottom of the ninth to force extra innings.

Jeremy Affeldt (1-0) pitched a perfect top of the 10th to notch the victory.

San Francisco trailed 2-1 entering the ninth, with Washington closer Rafael Soriano on the mound trying to halt the Nats' three-game losing streak.

Buster Posey greeted Soriano with a single back up the middle that deflected off the right-hander before trickling toward short.

Torres then replaced Posey as a pinch runner, but Soriano induced back-to-back fly outs and the Giants found themselves down to their final out.

Down 1-2 in the count, Blanco belted a slider over the head of Bryce Harper in right, allowing Torres to race around the bases for the game-tying run.

"I didn't want to hit the wall, for one," said Harper, who hesitated on the hit because of running into the wall last week in Los Angeles. "Of course it crosses your mind after you jam into a wall."

Soriano's blown save spoiled a stellar start from Washington right-hander Stephen Strasburg, who struck out seven and held the Giants to just one run on five hits and three walks over seven strong frames.

Strasburg's counterpart, Matt Cain, also dazzled in his no-decision, as the San Francisco righty allowed two runs on four hits and two walks with seven strikeouts over his seven-inning start.

"Facing each other, we thought it'd be a close game," said Cain. "Thought it would come down to the guy who made the most mistakes."

The Nats did all their damage against Cain in the first, as Denard Span smacked a leadoff single, moved to second on Harper's bunt and raced home on Ryan Zimmerman's double to center field.

After Adam LaRoche flied out, Ian Desmond deposited a two-bagger of his own into right field to score Zimmerman for a 2-0 lead.

The Giants left the bases loaded in the bottom half, but broke through in the second when Blanco slapped a leadoff single and moved to second on Cain's one- out bunt before scoring on an Angel Pagan single to center to make it 2-1.

Strasburg stifled the home team from there, as he kept San Francisco from moving a runner past second until he was lifted after seven innings.

Tyler Clippard then worked around a two-out double in the eighth, but Soriano was unable to hold the lead in the ninth.

Game Notes

Maya was recalled from Triple-A Syracuse before the game after pitcher Ryan Mattheus was placed on the disabled list with a broken right hand ... Scutaro extended his hitting streak to 19 games with a double in the eighth ... San Francisco placed pitchers Ryan Vogelsong and Santiago Casilla on the DL and recalled pitcher Sandy Rosario and first baseman Brett Pill from Triple-A Fresno ... Washington went 2-for-8 with runners in scoring position and left six men on base.