WASHINGTON - By the 18th inning Saturday night, the Giants and Nationals were like two exhausted boxers, punchy and delirious. Tension had long been replaced by resignation.

At some point, the longest playoff game in baseball history would come to an end, and it would be remembered less as a glorious triumph and more as an ode to survival. It became a test of sheer will, a test the Giants had passed so many times before, a test that the Nationals had routinely flunked.

So when Brandon Belt bashed a leadoff homer off Tanner Roark in the 18th, it all seemed inevitable. The Giants beat the Nationals, 2-1, in Game 2 and took a 2-0 lead in this National League Division Series.

At 6 hours, 23 minutes, it was the longest game in playoff history. It tied for the longest by innings, sharing that record with the Braves and Astros, who went 18 innings in the 2005 NLDS.

Nine innings earlier, with victory just one out away for the Nationals, it all unraveled so quickly, thanks to a questionable decision by manager Matt Williams, poor relief work by reliever Drew Storen and a mental meltdown by Asdrubal Cabrera.

Indeed, so much had conspired against the Nationals that bitter defeat never seemed far away. When it finally arrived, the remnants of a crowd that once numbered 44,035 was forced to confront a harsh reality.

After sticking through a windswept night at Nationals Park, they realize their team must win three straight in this best-of-five series -- with the next two in San Francisco -- to save their season.

It didn't have to be this way, perhaps the cruelest fate in a city that has known so much baseball agony.

Fresh off a no-hitter in the regular-season finale, righthander Jordan Zimmermann didn't miss a beat, retiring 20 in a row at one point. With two outs and no one on in the ninth inning, he needed only to retire Joe Panik to record a three-hit shutout and vanquish Giants counterpart Tim Hudson, who allowed one run in 71/3 innings.

Instead, with his 100th pitch of the night, Zimmermann walked Panik. Williams inexplicably emerged from the dugout with the hook -- a decision that began a chain reaction that led to the marathon.

In jogged Storen, given a chance to purge himself of the playoff failure that has stained his career, only to relive his personal nightmare.

It was Storen who blew a 7-5 lead against the Cardinals in the deciding game of the NLDS in 2012. And it was Storen who needed only three pitches to undo all of Zimmermann's work this time after inheriting a 1-0 lead.

Buster Posey ripped Storen's first pitch, a 95-mph fastball, to centerfield for a single, giving the Giants runners on first and second. Pablo Sandoval followed by lining Storen's second pitch down the leftfield line for a double.

Panik scored easily and Posey chugged along behind him, hoping to score the go-ahead run. But leftfielder Bryce Harper fired to shortstop Ian Desmond, whose throw arrived at the plate just ahead of Posey.

He went into a slide, touching his right foot on the plate, convinced that he had beaten the tag by Wilson Ramos. But umpire Vic Carpazza ruled him out, a decision later upheld by review. By a split-second margin, the Nationals had preserved a tie, but it wouldn't be long until their frustrations boiled over.

In the 10th, leadoff man Cabrera was ejected alongside Williams for arguing balls and strikes with Carapazza. Cabrera spiked his bat, slammed his helmet and wagged his right finger in the face of the umpire, who had called him out on a pitch up in the zone.

Williams arrived moments later to take up the fight. He, too, was sent to the showers. Eight innings later, the rest of the Nationals joined them.

Jayson Werth flied out to end the game and the Giants spilled onto the field. The Nationals slinked away, their season on the brink.