Matt Harvey came out of the game with a 1-0...

Matt Harvey came out of the game with a 1-0 lead after five innings against the Braves on Friday, June 9, 2017, in Atlanta. Credit: Getty Images / Kevin C. Cox

ATLANTA — There was cruelty to the way it ended, which has become standard fare in what has been an excruciating season for the Mets. In the bottom of the ninth inning in a 3-2 loss to the Braves on Friday night, the culprit was the raw energy that can only be generated from young legs, precisely the kind they have been lacking.

Dansby Swanson provided it, stretching a sure single into a daring double by preying on a moment of middling urgency by centerfielder Curtis Granderson. Swanson emerged from a cloud of dirt, his helmet thrown aside.

Moments later, he sprinted home with the winning run on Rio Ruiz’s pinch-hit single off lefty Josh Edgin to trigger a wild celebration.

“It just seems like every day, it’s something that happens that has kept us from getting going, be it an injury, be it a hanging slider, whatever it might be,” manager Terry Collins said. “We can’t seem to put it together right now.”

The Mets have a potential dynamo of their own, of course, though they have taken a conservative approach with Amed Rosario. The 21-year-old prospect remains at Triple-A Las Vegas, and club officials have given no indication that a promotion is in his immediate future. Of course, his presence alone won’t be enough to cure what ails the Mets (25-33), who again have fallen to eight games under .500. They are 12 games behind the NL East-leading Nationals and 9 1⁄2 games behind in the race for the second wild card.

Swanson, 23, was the latest to provide a nudge. The first overall pick in 2015 also had a two-run double and deprived Wilmer Flores of an eighth-inning hit with a sparkling play in the hole.

It came on a night in which Matt Harvey dodged trouble with five scoreless innings, only to watch the bullpen fail to protect a late lead.

Harvey has shown a knack for working out of jams, and though it’s not likely to be sustainable, it carried him through his outing. He allowed four hits and walked a pair but escaped damage.

In the last 33 at-bats in which opponents have come up with runners in scoring position, Harvey has allowed two hits. The Braves went 0-for-3 in such situations Friday night.

But Harvey’s tightrope-walking came at a price. His pitch count ballooned to 104, forcing Collins to lean on his bullpen.

“You’ve got to be able to go deeper into the game,” Harvey said. “That’s the part that’s frustrating to me about tonight, especially with a doubleheader tomorrow.”

It’s part of the reason the Mets intend to move into a six-man rotation, at least temporarily, in hopes that the starters will respond well to an extra day of rest. The experiment will begin this weekend, assuming both Seth Lugo and Steven Matz emerge from their first starts of the season with no issues.

Granderson gave the Mets a 1-0 lead in the third with his sixth homer, a drive over the centerfield fence. From there, Harvey held the line until his pitch count forced him from the game.

Paul Sewald took over in the sixth. It was the first time Collins trusted the rookie righthander to protect a one-run lead, and he immediately was under duress. Swanson, who began the night hitting .208, came through with a two-run double to give the Braves a 2-1 lead.

Travis d’Arnaud tied it with a solo shot in the seventh off Jason Motte.

In the ninth, after lacing a hit to center, Swanson slowed as he approached first, then turned it on when Granderson appeared slow to get to the ball.

“He had already made the turn, I think, before I got to the ball,” Granderson said. “He hustled out of the box, and that’s a great play by him. By the time I was able to get to it, he was on his way to second base.”

By then, it was too late. Moments later, Swanson was diving in the dirt again, this time at home plate, forcing the Mets to choke down another bitter loss.

Newsday LogoSUBSCRIBEUnlimited Digital AccessOnly 25¢for 5 months