RECIFE, Brazil -- Omar Gonzalez can't remember the last time he celebrated a loss.

But the U.S. defender did just that Thursday, standing in the middle of a rain-soaked field wearing a goofy grin and hugging anyone who came near after the U.S. national team lost for the first time in this World Cup, 1-0, to Germany.

That's because, 1,200 miles away in the Brazilian capital of Brasilia, Portugal beat Ghana, 2-1, knocking the Africans out of the tournament and sending the U.S. on to the second round, where it will meet Belgium on Tuesday.

"Definitely it has to be one of the best losses of my career," Gonzalez said with a smile.

Advancing with a loss is only the latest in a series of improbable events that have shadowed the U.S. in this World Cup.

In their first game, the Americans scored a goal in the opening minute, lost their star striker to a hamstring strain midway through the first half, then rallied to beat Ghana on a header by John Brooks, who days earlier had dreamed that would happen.

In its second game, needing a win to reach the second round, the U.S. gave up a goal with less than a minute left in stoppage time and had to settle for a gut-wrenching draw with Portugal.

Then came Thursday's group final with Germany. With a win, the U.S. would finish first in Group G. With a tie, it would clinch a place in the second round.

It got neither.

But thanks to a better goal differential, the U.S. is going on and fourth-ranked Portugal, which finished with the same record in group play but had a 4-0 loss to Germany, is going home.

Given little chance to survive the tournament's so-called "Group of Death," the U.S. team has been reborn in the 16-team knockout stage, where each game is an elimination game.

"Being able to advance out of a difficult group like we were in, getting to the knockout stages, it doesn't matter how it happens. You're there, so enjoy the moment," U.S. team captain Clint Dempsey said. "There were a lot of people who doubted us. But we always believed and we kept fighting.

"We deserve to be in the next round."

To get there, the U.S. team had to travel nearly than 9,000 miles -- far more than any other team in the tournament -- to its three group-stage games, playing Portugal in the sauna of the Amazon and Germany in a tropical rainstorm four days apart. Along the way Dempsey broke his nose and Jermaine Jones appeared to have broken his Thursday as well.

But they kept coming, kept defying the odds.

"It's a fantastic achievement by all the guys," U.S. Coach Juergen Klinsmann said. "It was for us hard, hard work. Tremendous commitment."

The only goal Sunday came in the 55th minute. After U.S. keeper Tim Howard made a splendid save on a header from Germany's Per Mertesacker, the rebound bounced outside the 18-yard box to Thomas Mueller, who pounced on it and sent a bending right-footed shot just inside the right post for his fourth goal in three games.

Even after that the U.S. retained a defensive posture, trying to protect its slender lead in the goal differential. As a result Germany enjoyed a huge margin in time of possession and had nine shots on goal to one for the U.S. -- and that didn't come until the final minute of stoppage time when Dempsey, unaware of what was happening in the other game, led a mini rally.

As it turned out, that wasn't necessary. Because even after being shut out, the U.S. is on to the second round.

"Everything's fresh," Dempsey said. "It doesn't matter what you've done in the group stages. It's what you're going to do on that day. And there's more pressure to that game because you either stay or you go home.

"You want to keep staying, you want to keep fighting for the opportunity to be in the tournament as long as possible."

And if the U.S. has proven anything, it has proven that it's very good at staying and fighting.

"We're going give everything we have and put everything we have into this match," defender Matt Besler said, "and see what we can do."