WASHINGTON >> Brandon Belt and the rest of the San Francisco Giants did what they do so well in October: They never give in, they never give up, and they win. Simple as that. No matter what it takes — or how long.

Even 18 innings.

On and on and on the Giants and Nationals played Saturday, until Belt’s homer off Tanner Roark leading off the 18th lifted San Francisco to its 10th consecutive postseason victory, edging Washington 2-1 on Saturday night for a 2-0 lead in their NL Division Series.

It tied the mark for most innings in a postseason game and, as late afternoon stretched into early evening and even past midnight, set a time record at 6 hours, 23 minutes. The teams combined to use 17 pitchers and 24 position players.

The Giants can close out the best-of-five NLDS at home Monday in Game 3, with Madison Bumgarner — who tossed a shutout against Pittsburgh in the wild-card game — facing Doug Fister.

That would be quite a sudden end to 2014 for the Nationals, who won the NL East and led the league with 96 wins. But after a pair of one-run losses, they’re looking as if they’re the latest team that can’t figure out how to get past San Francisco.

Down to their final out Saturday while trailing 1-0 in the ninth, the Giants tied it on Pablo Sandoval’s RBI double, then saw Nationals manager Matt Williams and second baseman Asdrubal Cabrera ejected in the 10th.

Yusmeiro Petit entered in the 12th and threw six scoreless innings, allowing one hit and striking out seven, to earn the win. Hunter Strickland got the save with a scoreless 18th.

Roark, Washington’s ninth pitcher, came on in the 17th. An inning later, he threw a 94 mph fastball on a full count to Belt, who missed 96 games this season because of a broken thumb and concussion.

When he drove the ball into the second deck beyond right field, Belt dropped his bat and admired the shot as the Nationals Park crowd fell silent. When Belt got to the dugout, teammates slapped him on his head.

Only one other postseason game in baseball history lasted 18 innings — when the Astros beat the Braves 7-6 in a 2005 NLDS. That one held the previous record for most time, too, at 5:50. Tim Hudson started that game for Atlanta — he was the Giants’ starter in this one.