Nationals pitcher Craig Stammen walks off the field after giving up the game-winning hit to the Giants' Freddy Sanchez during the 13th inning. (Ben Margot/Associated Press)

They call it “Torture” here, this brand of baseball that grinds your insides until the final out and turns competition into attrition. The Washington Nationals know it well. They played 24 innings of it the past two days, 8 hours and 27 minutes of bizarre baseball that left them jubilant Sunday and sullen on Monday, skulking off the field after the 13th inning, into a quiet clubhouse.

The Nationals blew a four-run lead and played deep into extra innings for the second straight day, and this time the San Francisco Giants made them pay with a 5-4, 13-inning defeat that felt like a stomach punch. They pummeled Tim Lincecum and John Lannan carried a shutout into the seventh inning. All of that unraveled until the 13th, when Freddy Sanchez smoked a two-out, walk-off single to right field off Craig Stammen, the 21st and final Nationals player who appeared.

For the second straight day, the Nationals had seized a four-run lead and blown it with an implosive inning from their bullpen. Sunday, they won in 11 innings. Monday night, against a team that thrives on biting its nails, the Nationals could not recover.

“We just found a way to not get it done,” Manager Jim Riggleman said. “And that’s a shame.”

On Saturday morning, Stammen was playing golf in Indianapolis when he received a call that stunned him: he had been promoted from Class AAA Syracuse, where he had been a starter all season, to the Nationals, where he would join the bullpen. He was thrilled, and he felt prepared.

San Francisco’s Freddy Sanchez, second from right, celebrates after hitting the game-winning hit against the Washington Nationals. (Ben Margot/Associated Press)

As the innings piled up Monday night, Stammen sensed he would be needed. “I knew I would have to come in eventually and be counted on for multiple innings,” Stammen said. His time came in the 13th, after the Nationals had cycled through five relievers.

Stammen had not pitched out of the bullpen this season, which he said did not factor in. “It’s still pitching,” he said. “No excuses.” But his performance suggested otherwise. Stammen walked the first batter he faced, backup catcher Chris Stewart, on four pitches.

The Giants had been out of position players for three innings, and so Stammen had the benefit of facing reliever Javier Lopez, whom he struck out. Andres Torres followed with a flare to right for a single. Miguel Tejada hit a chopper to short, possible salvation for Stammen. Ian Desmond flipped to Alex Cora, who had replaced the rocket-armed Danny Espinosa in a double switch. Cora’s throw hopped to first baseman Michael Morse, too late to retire Tejada.

Up came Sanchez, with runners on the corners and two outs. With the count 1-1, Stammen tried to fire a slider, down and outside. But “it wasn’t down,” he said. Sanchez ripped a line drive to right field. The Nationals watched, helpless, as Stewart walked home and the Giants mobbed one another.

“It was another tough game,” Morse said. “Wish we could have got this one. We were one hit away.”

The Nationals survived several forms of calamity just to reach the 13th inning. In the ninth inning, Henry Rodriguez put runners on the corners with one out. Desmond, playing in, calmly fielded a grounder and threw out Andres Torres at the plate. In the 10th, Cole Kimball walked reliever Jeremy Affeldt, forced into the batter’s box because the Giants ran out of position players, with two outs, only to rescue himself by striking out Torres with a 3-2 splitter. And in the 12th, Aubrey Huff drove Drew Storen’s first pitch to the warning track in left, where Roger Bernadina made a catch with his heels against the wall.

The Nationals’ best chance to end it came in the 12th. Matt Stairs started a rally with a one-out single. With two outs and two on, the Giants walked Jayson Werth to load the bases for Rick Ankiel against a sidearming lefty — the exact set-up that led to their 11th-inning victory Sunday. This time, though, Javier Lopez got Ankiel to fly out to right.

Ivan Rodriguez of the Washington Nationals reacts after striking out in the eleventh inning. (Jed Jacobsohn/Getty Images)

The Nationals, though, for the second straight day, should not have needed extra innings. Todd Coffey worked the Nationals into a jam in eighth inning, putting runners on second and third with one out after Cody Ross ripped a double down the left field line. In came Sean Burnett to face left-hander Aubrey Huff. Burnett put Huff in a 1-2 count with a change-up that had Huff shaking his head. He fouled off two pitches, and Burnett tried a slider, low and away.

“Sean threw a great pitch,” catcher Ivan Rodriguez said.

Huff, though, flared a hit emblematic of Burnett’s season: a bloop into shallow right that scored two runs.

“Hopefully, the luck changes,” Burnett said. “That’s the frustrating part. I feel like I’m throwing the ball really well. I got nothing to show for it. I know it’s result-orientated, and my results suck.”

With a string of right-handers coming up, Riggleman asked Henry Rodriguez to preserve the lead. He struck out Aaron Rowand looking at a nasty curveball, but Brandon Crawford and Nate Schierholtz both blooped singles feet from defenders. Huff scored the tying run, barely beating Bernadina’s throw.

“Sometimes, when those balls are now hit well but they’re hits, they’re up,” Riggleman said.

The final innings ripped up what could have been an encouraging victory for the Nationals. They knocked Lincecum out after five innings, nearly beating him for the second time this season and the fourth straight time since 2009. Morse led the Nationals’ latest assault on Lincecum, who entered Monday night with a 2.59 ERA this season. He launched a titanic solo home run in the second inning and lashed a two-run, opposite-field double in third. Combined with his 11th-inning grand slam Sunday, Morse drove in seven runs in a span of three at-bats. Morse has seven homers since May 23, a binge unmatched in baseball over that span.

Last May at this park, the Nationals thrashed Lincecum, scoring six runs and stealing four bases against him in 42 / 3 innings. This April, the Nationals scored three runs at Nationals Park in seven innings, enough to win. Since 2009 began, Lincecum has a 5.87 ERA against the Nationals and a 2.79 ERA against everyone else.

Monday night, though, still included one excellent starting pitching performance. After almost every one of his first 10 starts, Lannan repeated a version of same refrain. He referred to his starts as “a battle,” trying to find the right feel for his sinker.

Three starts ago, Lannan found it and has carried it over. Lannan entered Monday having not allowed an earned run in his past two starts, a span of 13 innings. He carried a one-hitter into the sixth inning Monday, and he continued his streak without allowing an earned run alive until Rowand led off the seventh with a solo home run.

The homer seemed like an innocent blemish. Hours later, the Nationals had to swallow as where their night began to unravel, the start of a torturous loss.