SAN FRANCISCO — Bryce Harper screamed out in delight as he crossed the plate with Washington ahead at last. After all those extra innings and a subdued cross-country flight, the Nationals had broken through — with a little help from Madison Bumgarner.

Doug Fister pitched seven shutout innings, and the Nationals capitalized on Bumgarner’s one off-target throw, staving off elimination in the NL Division Series with a 4-1 win over the San Francisco Giants on Monday.

Fister dazzled again in San Francisco, helping the Nationals cut their deficit to 2-1 in the best-of-five series. They ended the Giants 10-game postseason winning streak that started with Game 5 of the 2012 NL Championship Series against St. Louis.

Washington scored two runs on Bumgarner’s throwing error in the seventh inning to end the ace’s 21-inning scoreless streak. Harper punctuated the victory with a solo homer in the ninth.

“Really it came down to every pitch,” Fister said. “Fortunately a ball bounced our way.”

Drew Storen allowed to the first two batters to reach in the bottom of the ninth but shook off his postseason struggles, allowing a run in closing it out as Washington forced a Game 4 on Tuesday night.

Now, the 96-win Nationals will send left-hander Gio Gonzalez up against San Francisco right-hander Ryan Vogelsong.

“We just needed one break,” Storen said. “It’s been a tough couple innings here to start and we got our break. It’s just a matter of building on it, and we live to see another day.”

On a day Bumgarner had been nearly untouchable, his own miscue prevented a three-game sweep.

Bumgarner fielded Wilson Ramos’ two-strike sacrifice bunt between the mound and the first-base line and fired to third rather than going for the sure out at first.

“We probably should have taken the out of first. I made a mistake telling him to throw to third,” catcher Buster Posey said. “It happens. We’ll come tomorrow, go through the pre-game routine and be ready to go.”

Bumgarner’s throw sailed wide of Pablo Sandoval’s outstretched glove and bounced all the way to the tarp along the left-field wall before rolling over the bullpen mounds where two relievers were warming up.

Sandoval nearly did the splits trying to make the play and stayed down in pain as the two runs scored. Trainers checked on the third baseman and he remained in the game.

“We don’t have Ramos bunt with two strikes,” Harper said. “So if we don’t have him get that bunt down, at least get us on second and third, having that errant throw by Bumgarner was huge for us.”

Asdrubal Cabrera followed with an RBI single. He spent the final eight innings watching the Giants’ 2-1, 18-inning victory Saturday night after his ejection for arguing a called third strike.

Fister outpitched Bumgarner at AT&T Park for the second time in four months after a June gem, leaving behind the frightening memory of his October outing here in Game 2 of the 2012 World Series. Fister took a line drive to the right side of his head that day — while also opposing Bumgarner — but stayed in the game and carried a shutout into the seventh before Detroit lost 2-0 and was swept.

Fister hardly needed that Japanese good luck figurine that appeared in the NL East champions’ dugout Monday morning courtesy of backup catcher Jose Lobaton. The right-hander, who grew up about two hours away in the Central Valley city of Merced, gave up four hits, struck out three and walked three.

Storen, the beleaguered closer who gave up the tying run in Game 2, allowed Brandon Crawford’s sacrifice fly in the ninth before finishing the 2-hour, 47-minute game. It was a far cry from Game 2, which took a postseason record 6:23.

Five days after pitching a four-hitter in an 8-0 wild-card win at Pittsburgh, Bumgarner was on a roll again, this time for the orange towel-waving sellout home crowd of 43,627.

Ian Desmond singled to start the decisive seventh and Harper walked to bring up Ramos, who began the season as the Nationals’ cleanup hitter. Harper slid into home for the second run, hopped up and hollered in triumph.

Bumgarner hadn’t given up a postseason run since Carlos Beltran homered in the fourth inning of the Giants’ Game 1 loss of the 2012 NLCS in St. Louis.

The pitcher had chances with the bat, too. He came to the plate with the bases loaded and two outs in the second to cheers of “Bum! Bum!” before striking out.

Sandoval extended his postseason hitting streak to 14 games with a leadoff single in the second, the longest streak in Giants postseason history and currently in baseball.

Brandon Belt was caught stealing in the fourth, only the second time anyone tried to steal against Fister all year.