Joy swelled through every corner of Nationals Park late Thursday afternoon, following a landmark victory by the winningest Washington Nationals team in six years. But before the 21,161 ecstatic fans could reach the exits, and the players could change into their street clothes for their flight to Chicago, euphoria faded into shock, then shattered into a jumble of emotions.

Manager Jim Riggleman had chosen this heady moment — the day the Nationals moved over .500 in June for the first time since 2005 — to resign abruptly, taking a principled stand against what he saw as an unfair contract situation: the team’s refusal to pick up the option that would have kept him in place for the 2012 season.

“I’m 58,” he said. “I’m too old to be disrespected.”

The stunning news caught the Nationals completely by surprise. Riggleman had informed his boss, General Manager Mike Rizzo, only 45 minutes before first pitch of his intention to resign after the game if his contract situation were not addressed in a substantive way, and it wasn’t until after Riggleman’s resignation was accepted — before the clubhouse scent even had a chance to morph from sweat and pine tar to Axe body spray and cologne — that the players were informed.

“It was an extremely festive, upbeat locker room,” Rizzo said at a hastily arranged news conference, his hands trembling slightly and his voice stern, moments after breaking the stunning news to the players. “It became somber quickly.”

Outfielder Laynce Nix, whose ninth-inning sacrifice fly gave the Nationals a 1-0 victory over the Seattle Mariners, said: “I don’t even know what to think. I just know we’re playing well, and we have a game tomorrow.”

While players were left to process one of the more bizarre midseason managerial moves in baseball history, Rizzo was left scrambling to find someone to manage the team for the rest of the season. While John McLaren, Riggleman’s bench coach and close friend, will serve as interim manager beginning Friday night in Chicago, there was no indication how long that arrangement would last — or even whether the Nationals will try to bring in someone else this season.

The juxtaposition of on-field fulfillment and off-field turmoil created a surreal scene in the Nationals’ clubhouse. Normally, music would be blaring and players beaming following a win such as Thursday’s, the Nationals’ 11th in their past 12 games. Instead, the music was abruptly shut off, leaving players to dress somberly at their lockers as the buses idled outside, casting glances at the center of the room, where a man who was no longer a part of their tight-knit unit, Riggleman, took questions from the media.

“I know what the right thing to do is,” Riggleman said. “You don’t keep a manager on a one-year deal in major league baseball.

“I’m not happy about it. I just feel in my heart it’s the right thing to do.”

Riggleman’s unhappiness over his contract situation had been an open secret around the team almost since the day it was signed, Nov. 9, 2009. Although the Nationals called it a three-year deal at the time, it was more accurately a two-year guaranteed deal with a low buyout after the first season and a team option for 2012 — effectively keeping Riggleman on a year-to-year basis, and at a salary, $600,000, that ranked among the lowest in the game.

Whether it was true or not, Riggleman felt as if the Nationals were merely keeping him around as a low-cost, low-leverage placeholder until the team was ready to contend, at which point, presumably, they would bring in a bigger name.

“I made it very clear that I didn’t like [it], but you know I can’t say no to it,” Riggleman said, recounting his conversations with team management when he signed the contract. “So there I am, and two years later, I’m realizing, ‘You know what? I was right. That’s not a good way to do business.’”

After lobbying for a stronger commitment from ownership failed to improve Riggleman’s standing, he asked to speak to Rizzo in his office. Riggleman said he merely wanted the promise of a substantive conversation regarding his contract. Rizzo characterized it as more of an ultimatum: Pick up the 2012 option, or I quit.

Whatever the case, Rizzo said he was not prepared to make a “knee-jerk” decision. As the game played out, Rizzo resolved to accept Riggleman’s resignation, if in fact it was tendered — which, after a second brief meeting after the game, it was.

“I’m disappointed at the timing of it,” Rizzo said. “We’re playing so well. Coming off a homestand that we should be celebrating going into Chicago, coming off a great month of playing baseball. I think we’re starting to really hit our stride. And I’m disappointed that this is a distraction. This is not thinking of the team first. It’s thinking of personal goals and personal things first. And that’s probably what disappoints me most.”

Riggleman said he asked to address the players, but the request was denied. Several players, though, trickled into his office to say goodbye before boarding their buses. It was no simple matter, reconciling their respect for Riggleman’s principled stand with the realization he had abandoned them in midseason.

“I can see both sides of it,” closer Drew Storen said. “I understand he needs to take care of himself. . . . It’s going to test us, but I think we’re going to get through it, and in the end we might even come out better.”

At 5:09 p.m., two buses pulled out from the bowels of Nationals Park, pointed toward Reagan National Airport, then on to Chicago. The future appears bright for the Nationals, never more so than on this day — with an above-.500 record, promising top prospects and a fan base starved for a winner.

But when Jim Riggleman looked at that future, he didn’t see a place for himself in it, and so the Nationals’ traveling party Thursday night was one person short.

Staff writers Adam Kilgore and Shemar Woods contributed to this report.