Ryan Zimmerman's 30-game hitting streak ended when he went 0 for 3 with two walks, but Shairon Martis allowed two hits over seven sharp innings to remain unbeaten this season in the Washington Nationals' 6-3 victory over the San Francisco Giants on Wednesday.

Zimmerman never got the ball out of the infield, falling just short of Vladimir Guerrero's franchise-record streak of 31 games for the Montreal Expos in 1999. After two groundouts and two walks against Giants starter Barry Zito, Zimmerman grounded into a fielder's choice against reliever Pat Misch in the ninth.

San Francisco's fans still gave him a standing ovation, and Zimmerman slid home with Washington's sixth run moments later, beating a throw from the infield.

Nick Johnson hit an RBI double in the fifth and Elijah Dukes drove in two runs with a broken-bat single in the seventh for the Nationals, who avoided a three-game sweep in San Francisco while snapping a nine-game losing streak to the Giants.

Zimmerman's streak ended right before Washington returned for a 10-game homestand at Nationals Park, where the club with the majors' worst record could have used something to celebrate.

Zimmerman grounded into a double play in the first inning and drew a walk in the third. After grounding out to shortstop in the fifth, he came up with two runners on in the seventh _ but after Zito threw a wild pitch allowing both runners to advance, the Giants elected to walk Zimmerman intentionally.

Somebody in the Washington dugout appeared to throw water onto the field after the intentional walk. Zimmerman then grounded to shortstop in the ninth, ending the majors' longest hitting streak since Moises Alou hit in 30 straight games for the Mets in 2007.

Martis (5-0), who walked four batters and hit another but didn't allow a run until the seventh, is responsible for nearly half of the Nationals' 11 victories this season. The former Giants farmhand also doubled and scored the game's first run in the fifth.

Kip Wells earned his second career save.

Zito (1-3) gave up eight hits and four runs while pitching into the seventh, losing control of a tight game late in another tough loss on his 31st birthday.

The Giants scored 20 runs in the series' first two games, including Pablo Sandoval's game-ending three-run homer on Tuesday night. San Francisco couldn't score against Martis until Rich Aurilia's sacrifice fly in the seventh.

The Nationals' bullpen struggled yet again, however. Sandoval added an RBI single in the eighth off Joe Beimel, who allowed Sandoval's homer the previous night. Nate Schierholtz then tripled and scored in the ninth, but Wells escaped trouble.

Notes:@ Giants OF Fred Lewis has a minor toe injury, but he drove home Schierholtz with a pinch-hit double in the ninth. ... Adam Dunn wasn't in Washington's starting lineup, but he popped out on one pitch as a pinch-hitter in the eighth.