RECIFE, Brazil — Losses aren’t supposed to feel this good. In sports the verdict is usually spelled out in giant numerals, distinct and resolute. And there was certainly nothing ambiguous about Thursday’s final score: Germany 1, United States 0. But no sooner had the game ended than the narrative received a red, white and blue-colored plot twist.

The Germans won but the U.S. celebrated.

Once the thousands of rain-soaked fans learned Ghana was eliminated from World Cup play and the United States would kick another ball, the celebration began in earnest.

“U.S.A.! U.S.A.!” they chanted from every corner of Arena Pernambuco.

In Washington’s Dupont Circle, thousands joined in. And in Chicago’s Grant Park, and in New York’s Times Square, too.

“It’s pretty weird,” admitted an elated Omar Gonzalez, the U.S. defender who’s playing in his first World Cup.

The weirdness, which hinged on Portugal’s 2-1 win over Ghana in Brasilia, ensured the United States would finish the final day of first-round play with the second-best mark in Group G – the so-called “Group of Death” because of the pedigreed competition. The Americans will move on to the do-or-die Round of 16, where they will face Belgium on Tuesday. The loser goes home; the winner heads to the quarterfinals.

“Now we really get started,” said Jurgen Klinsmann, the German-born American coach. “Now we can put this behind us, the whole group phase. The knockout stage is a completely different ballgame.”

The American fans who traveled here persevered through an all-day storm, flooded city streets and an exasperating scoring drought. But suddenly, as play came to a halt, none of that mattered. They bounced, waved flags, swung scarves. They chanted and sang, and cheered themselves hoarse.

The stakes couldn’t have been higher. After beating Ghana and playing Portugal to a tie earlier in the tournament, the Americans knew a win or draw was needed Thursday to advance. As it turned out a loss was enough, too.

“We didn’t qualify just because of this game,” defender Matt Besler said. “We qualified because of all three of the games. All three mattered and we did enough to advance.”

Sunil Gulati, president of the U.S. Soccer Federation, called it the biggest game the United States has ever played “because the country was paying attention in a way that it’s never paid attention,” he said.

Back in the States, business came to a halt as employees gathered in break rooms and huddled around television sets. Many others left work early, settling into bar stools or living-room couches. In fact, one day earlier Klinsmann encouraged fans to skip work, sending an excuse note via Twitter for fans to deliver to bosses.

The tournament occurs only once every four years, and though the United States has found modicum levels of success before, television ratings and American interest have hit new levels. This marks the second straight World Cup that the United States reached the Round of 16, and though the team is certainly no favorite to compete for the title, the way it battled through a difficult group despite missing injured striker Jozy Altidore the past two games has captured the imagination of fans of all levels.

“It’s extraordinarily important that we get four, five, six days and hopefully more of intense interest in the United States,” Gulati said.

The Americans failed to mount many offensive opportunities, something that will have to change against Belgium.

“We all understand that we’re gonna have to play better,” Besler said.

While the Americans knew they controlled their own fate and could advance with at least a tie, players said they tried to avoid hearing updates on the Portugal-Ghana game.Klinsmann said he received an update shortly after Portugal scored its second goal, but most players said they didn’t learn of their good fortune until after the loss. Exhausted and soaked, they were able to enjoy a tired on-field celebration.

“I think all three games took a little bit of a toll on everybody,” Besler said.

But they advanced and that means U.S. soccer fans have reason to keep their red, white and blue paraphernalia handy.

The U.S. team might have lost, but the sport and its passionate fans scored a big win.