RECIFE, Brazil — They heard about people back home watching during their lunch breaks, streaming on office computers, or playing hooky with fellow fans. And then, as the bus pulled away from the hotel Thursday, the US World Cup team was struck with an unusual sight.
Hundreds, maybe thousands of fans in red, white, and blue, walking for miles around stalled cars through nearly hip-high water along streets and highways, making their way to the stadium to cheer them on.
‘‘That kind of passion to root us on is what really helps drive us,’’ defender Omar Gonzalez said. ‘‘Now we give them another game to go to.’’
No dramatic late goals in this one. Not even a win. But despite a 1-0 loss to Germany, the United States was good enough to advance to the knockout stage of consecutive World Cups for the first time and good enough to hold onto the national attention that soccer has finally grabbed in America.
‘‘I'm getting e-mails from people who work at companies where the executives have called a three-hour break and put on giant screens,’’ US Soccer Federation president Sunil Gulati said. ‘‘All of this . . . is pretty extraordinary, and that will build for the next few days.’’
Thomas Mueller scored off a rebound in the 55th minute to give Germany first place in Group C with 7 points, but the Americans held onto second when Portugal defeated Ghana, 2-1, in a game played simultaneously in Brasilia.
Two minutes after Mueller’s goal, Asamoah Gyan tied the score, leaving the Black Stars one goal from tying the US with 4 points and moving ahead on the second tiebreaker, goals scored. But then Cristiano Ronaldo put the Portuguese back ahead in the 80th, giving the Americans a little margin for error.
On the sideline, US goalkeeper coach Chris Woods used his fingers to signal ‘‘2-1’’ to goalkeeper Tim Howard. But Howard was unsure which team was ahead.
‘‘Then Woods gave the thumbs up — in our favor,’’ US defender Matt Besler said.
Around the same time, the American fans behind the goal defended by Germany goalkeeper Manuel Neuer started cheering, having learned of Ronaldo’s goal from whatever electronic device they had brought along.
‘‘Kind of calmed me down the last five minutes a little bit,’’ US coach Jurgen Klinsmann said.
Portugal opened with a 4-0 loss to Germany and tied the US, 2-2, Sunday with a 95th-minute goal, so the Americans had an even goal difference while the Portuguese were at minus-3.
The Americans advance to a round-of-16 game Tuesday in Salvador against Belgium.
The US team started celebrating at the final whistle, 30 seconds before the other game ended. The script was similar to that of 2002, when the US opened with a 3-2 win over Portugal, then tied South Korea, 1-1, and lost to Poland, 3-0.
The Americans advanced 12 years ago because South Korea defeated the Portuguese on an 80th-minute goal.
Germany scored when Mesut Ozil took a short corner kick, received a pass back, and crossed to Per Mertesacker. His header was parried by Howard into the path of Mueller, who curled a right-footed shot from 18 yards inside the far post.
Germany had 63 percent possession and had nine shots on goal to one for the U.S.
Klinsmann hugged Germany coach Joachim Loew — his assistant coach on Germany’s 2006 World Cup team — and Brad Davis raised both hands after the final whistle and led the applauding US team to the side of the stadium where the majority of American supporters sat.
The victory was especially satisfying for a pair of American players: midfielder Jermaine Jones played three games for Germany in 2008 before switching allegiances and right back Fabian Johnson started for Germany in the 2009 European Under-21 Championship final.
Jones thought back to a Times Square rally last month when former national team players Alexi Lalas and Taylor Twellman, now ESPN broadcasters, predicted the Americans would not advance.
‘‘We showed some people,’’ he said, ‘‘people that were talking like we have no chance to come through to the next round.’’