WASHINGTON -- San Francisco Giants rookie second baseman Joe Panik walked up the steps from the visiting dugout Friday night, carrying two bats with a dirt stain on the back of his right pants leg.

Minutes later, he had a bandage wrapped around his left hand, leftovers from a long but historic night for the New Yorker, who was playing in the minor leagues a little over two months ago.

Panik had a career-high four hits and three RBIs, including his first big league homer, as the San Francisco Giants ended the Washington Nationals' 10-game winning streak with a 10-3 victory on Friday.

"It was definitely a good swing," Panik said of his three-run homer in the fourth against Washington starter Doug Fister. "I wanted to drive the ball with two outs."

Panik had made the first error by the Giants in 11 games that led to a 1-0 lead in the first by the Nationals. "It was good to get those runs back," said Panik, who had friends from New York at the game.

It was the first major league homer for Panik in 130 at-bats and it ended a streak of 25 innings in which Fister had not given up an earned run.

Panik "has a stoic way about him," said Giants manager Bruce Bochy, whose team arrived in Washington around 6 a.m. Friday from Chicago. "He has a nice focus out there. He is very competitive. You can see it in his eyes. I just think he has a great way about him. He is a tough kid. He competes well."

Right-hander Tim Hudson picked up his 18th career win against Washington, which had tied a franchise record with its winning streak. "He has had great success against us," Nationals manager Matt Williams said of Hudson.

The Nationals (73-54) began the day seven games ahead of the Atlanta Braves in the National League East, while the Giants (68-59), who won their third in a row, started 3 1/2 games back of the Dodgers in the National League West.

The Nationals could have set a franchise record for consecutive wins with a victory Friday.

"It's one of those days. Kind of a clunker all around," said Williams. "We'll see if we can start another one tomorrow. Those don't come around very often. It's pretty rare to see 10 in a row, but we've got to get back to work tomorrow and see if we can start another one."

Panik, who entered the game with an average of .397 in August, went 4-for-5, including a broken-bat single to right in the eighth. Panik then scored on a two-run double by first baseman Travis Ishikawa to make it 6-2.

Panik, whose error led to a 1-0 Washington lead, atoned for that when he hit a three-run homer in the fourth against Doug Fister (12-4) to give his team a 3-1 lead. The Giants made it 4-2 in the top of the sixth on a solo homer by catcher Buster Posey (two hits), and the eighth-inning hit by Ishkiawa off reliever Jerry Blevins curtailed hopes of a sixth walk-off win in seven games by the Nationals.

Those dim hopes were further crushed in a four-run ninth to make it 10-2 against reliever Ross Detwiler.

Hudson (9-9) allowed two runs in 6 1/3 innings. Fister gave up seven hits (two homers) and four runs in six innings. Fister said after the game he had skin cancer removed from his neck a few days ago. "It had no effect tonight," he said.

Washington right fielder Jayson Werth also had two hits, as did Giants center fielder Angel Pagan.

The Nationals hope to rebound on Saturday. "We'll see if we can start another one (streak) tomorrow," Williams said. "Those don't come around very often. It's pretty rare to see 10 in a row, but we've got to get back to work tomorrow and see if we can start another one."

NOTES: In games through Thursday, the Nationals had won five of their last six games in walk-off fashion, the first team to do that since the 1986 Houston Astros, according to Elias. Washington entered play Friday with six one-run wins in its last seven games and six walk-off victories since Aug. 7. ... Giants RHP Tim Lincecum (10-8, 4.48 ERA) will face Washington RHP Jordan Zimmermann (8-5, 2.97) on Saturday. ... Giants LF Michael Morse, who was in the fifth spot in the batting order Friday night, hit 31 homers for the Nationals in 2011 and 18 the next year in his last season with the Nationals. ... Washington 3B Anthony Rendon entered play Friday with 88 runs, the most in the major leagues. He had the winning hit Wednesday against the Arizona Diamondbacks and his grounder led to an error as CF Denard Span scored the winning run Thursday in a 1-0 victory over Arizona.