It ended as these games end, with a pile of humanity in the middle of a diamond, and that’s the image these Washington Nationals will hang on walls throughout the city. But at the bottom of that pile Tuesday night at the center of Nationals Park, so many memories were squashed. Repress them, Washington, because there are new versions now. Where grief was once expected, now there’s nothing but possibility.

These Nationals changed that for themselves and their city. They beat the St. Louis Cardinals, 7-4, in Game 4 of the National League Championship Series, completing a dominant — if surprisingly dicey — sweep at a delirious ballpark whose denizens preferred not to, or simply couldn’t, sit down. In a town with a baseball history that can best be described as complicated, the significance of that victory is multilayered.

What matters, though, is just one thing: The Washington Nationals are going to the World Series.

“That sounds pretty sweet,” said first baseman Ryan ­Zimmerman, the only player who has appeared in all 15 seasons since this franchise returned baseball to the nation’s capital. “Been through a lot. Obviously, got close before. But this group of guys — wow.”

Zimmerman and his teammates, who moved from an on-field celebration into a champagne-soaked clubhouse as Tuesday turned to Wednesday, praised one another for enduring not only a Game 4 that turned from tranquil to turbulent, but for the season that preceded it — which is worth reviewing.

“It’s been quite a wild ride,” said General Manager Mike Rizzo, responsible for assembling the roster, “starting the way we started and finishing it the way we finished.”

It wasn’t finished until reliever Daniel Hudson induced a lazy flyball that center fielder Victor Robles allowed to settle into his glove, and that mob filtered from the dugout into the center of the diamond. But that emotional scene doesn’t begin to explain the evening, which began with an eruption and ended with fingernails hanging onto the edge of a cliff.

After one inning, the Nats led 7-0. The home crowd of 43,976 bounced with jubilation. The pennant seemed clinched. This was a walkover, and the crowd sensed it.

Here’s the problem: Washington’s baseball past is littered with calamity, and the Cardinals are one of the sport’s proudest franchises. Sweeps aren’t easy. Pennants aren’t granted. By the fifth, St. Louis was within three runs. In the eighth, the Cardinals had the tying run on base and the go-ahead run at the plate. Anticipation had turned to anxiety. There would be joy. But torment had to precede it.

“I knew those guys weren’t going to quit,” Zimmerman said.

“I had a calmness about me,” Rizzo said.

Speak for yourself. The heartache of previous Nationals teams is fresh in the minds of so many who crowded in Tuesday night. But the angst that goes back generations here is rooted not only in baseball failures but, worse, baseball’s absence.

Washington’s most recent World Series appearance came in 1933 — in a different time with a different franchise. Back then, the Senators of Goose Goslin, Heinie Manush and Joe Cronin were no match for the New York Giants, losing in five games. Eight years prior, Walter Johnson — forever the best player in Washington history, a Hall of Famer — pitched Game 7 against the Pittsburgh Pirates. But shortstop Roger Peckinpaugh booted one ball in the seventh, another in the eighth, and the Pirates came from behind to win.

So 1924 stands as the high-water mark in Washington baseball’s development, the only World Series title, built not only on the right arm of Johnson, who came out of the bullpen for four shutout innings of relief in Game 7, but on the bad – or, in Washington’s case, great – bounce of Earl McNeely’s grounder past third, which scored the winning run in the 12th, granting the Senators the title over the Giants.

Before this October, McNeely’s ball off a pebble could have been considered the most recent meaningful bounce in District history. It was 95 years ago.

But at least in those days, there were bad hops — and lousy finishes — to lament. The Senators and their fans, a dwindling lot, suffered for decades. One team left for Minnesota to become the Twins. An expansion team replaced it for 11 seasons before it left for Texas to become the Rangers. Between them, from 1933 to 1971, they combined for five winning seasons. You can’t be a baseball fan in the District and not know the phrase, “Washington: First in war, first in peace, last in the American League.”

But then came 33 summers without baseball. So for longtime Washingtonians, there has been a legitimate question as to what’s worse: the jarring pain from kick-in-the-stomach postseason losses, or the dull ache of not having baseball at all?

When Major League Baseball moved the Montreal Expos to Washington before the 2005 season, considering such questions seemed unrealistic. The re-branded Nationals were a mess of an organization that had been owned and run, nearly into the ground, by Major League Baseball itself. They made run-down RFK Stadium their temporary home. They finished in last place five of their first six years. Their farm system was threadbare, their scouting operation understaffed, their ballpark outdated. The playoffs seemed out of reach. Not in a specific season. In any season.

In 2006, MLB sold the franchise to the family of local real estate magnate Ted Lerner, and a slow rebuild began. The first winning season — and first National League East title — came in 2012, and October baseball somehow transformed into an expectation. Yet each appearance caused a wound, losses in the first round in ’12, ’14, ’16, and ’17. Those who care know the gruesome particulars. They also understand those events, when Nationals Park emptied in a near silent shuffle to Metro and beyond, make the accomplishment Tuesday night mean more.

“We’re in uncharted waters,” said Mark Lerner, Ted’s son and now the club’s managing principal owner. “The Cardinals have been through it. The Dodgers have been through it. This is all new for everybody in this building.”

That this club altered that trajectory borders on preposterous. The numbers that need to be known, that could be on T-shirts and tattoos around here, are ­19-31 and 5/23. On May 23 — all together now — the New York Mets finished off a four-game sweep of the Nationals, who were on pace to lose 100 games. Only one team in the National League owned a worse record. The World Series? Please. A winning record seemed unlikely.

“Obviously, I wasn’t too happy,” Lerner said. “Nobody was. I couldn’t imagine what happened the rest of the season. I would have never believed where we are today. A turnaround like that only happens once in a blue moon, so I can’t say I totally expected it. I didn’t.”

Who did? Maybe — maybe — the people inside the clubhouse, who understand that 50 games gone in a season means there are 112 left. Manager Dave Martinez, criticized in a disappointing 2018 as well as through May, remained outwardly buoyant. His approach, stated perhaps 112 more times, was to enter each day with a single goal: Go 1-0 today.

“You got to earn it,” said infielder Howie Kendrick, named the MVP of the series. “All the losing in the past, all the failures . . . it makes it sweeter.”

Which has to impact how this all feels. With the relief pitchers flailing, Rizzo added Hudson and two other relievers via trade. They added veterans cast aside by other teams. They began dancing in the dugout after home runs. From May 24 to Tuesday night, they have the best record in baseball.

“We say it all the time,” Hudson said. “I don’t know if a younger team could have survived that kind of start.”

“I love this team, man,” said retired outfielder Jayson Werth, a central figure on the previous four Nats playoff teams. “It takes talent. But it takes chemistry, too, and these guys prove that.”

What’s left to prove: Only winning a World Series championship, either against the New York Yankees or the Houston Astros. But for now, allow yourself a long, sweet, exhale, and consider what’s ahead and what’s past. Since its previous World Series, Washington has been a laughingstock of a loser, a baseball wasteland, and a reclamation project.

Now, the Nationals are National League champions. It’s the kind of accomplishment that a team and its town can wake up to on Wednesday morning, look at the scars that have now healed, and feel pretty darned good about itself.

Read more Nationals coverage: