RECIFE, Brazil — The U.S. national soccer team advanced Thursday to the next round of the World Cup, thanks in part to a handsome and talented chap playing 850 miles away.

While the Americans failed to control their future, losing to Germany 1-0 at soggy Arena Pernambuco, the Portuguese star Cristiano Ronaldo scored a late goal to all but end Ghana’s hopes of catching the United States in the Group G standings.

The Americans (1-1-1) finished second in the so-called Group of Death, even on points with Portugal (1-1-1) but well ahead on the first tiebreaker, goal difference. The United States finished with as many goals for as against, while Portugal, a 2-1 winner over Ghana (0-2-1) in Brasilia, was minus-three.

Said Sunil Gulati, president of the U.S. Soccer Federation: “Group of Death, I died a few times. It is a little bit of an odd feeling because you have lost your last game but we are dancing. We did what we needed to do in this group.”

At 4 p.m. Tuesday in a Round of 16 game in Salvador, the Americans will play Belgium, the winner of Group H.

“We’re going to take it to them,” U.S. Coach Jurgen Klinsmann said. “I think for all the players it’s a tremendous achievement, but now we really get started.”

Needing just a tie, Germany (2-0-1) won the group and will meet Algeria, Group H’s second-place finisher, Monday in Porto Alegre.

Klinsmann was kept updated on the Portugal score throughout Thursday’s match. “Kind of calmed me down the last five minutes a little bit,” he said, “except maybe a couple of calls that I didn’t like that much.”

The Americans will compete in the knockout stage for the fourth time in seven appearances since ending a 40-year qualifying drought. It’s the first time the U.S. advanced out of group play in consecutive World Cups.

“As we know from the past, once the group is done another tournament actually starts. The knockout stage is a completely different ballgame,” Klinsmann said. “We can’t wait to get that started now next week.”

Klinsmann, the German-born U.S. coach, provided two surprises in the starting lineup: He dropped center back Geoff Cameron for Omar Gonzalez and replaced Alejandro Bedoya with Brad Davis on the left wing.

Cameron played well in the opener against Ghana but struggled in the Portugal affair. Gonzalez had made one brief appearance, entering in the closing moments of the second game. Bedoya started the first two matches but had complained of a hip pointer after the first outing.

Davis, 32, from the Houston Dynamo, made his World Cup debut.

Despite a torrent of rain, the field was in decent condition and didn’t have the pronounced impact initially feared during pregame inspections.

“I think the weather conditions were difficult for both teams,” Klinsmann said, “but the pitch was surprisingly good.”

It certainly didn’t bother the Germans, who set the terms from the first minute and moved the ball with purpose and efficiency.

At one point their passing success rate was an unfathomable 97 percent, although most were short and unpressured.

“I think Germany, for the reasons you saw today, is among the top four or five favorites to win this title,” Klinsmann said. “It was for us, hard, hard work, tremendous commitment. We’re growing, learning with every game.”

The Americans absorbed pressure and survived jittery moments. Tim Howard smothered Lukas Podolski’s low cross as Thomas Muller loomed. Gonzalez whiffed on a clearance at the 6-yard box and, on a promising lead in the penalty area, Germany’s Benedikt Howedes and Per Mertesacker both stabbed at the ball, canceling one another.

“We kind of had a little bit too much respect the first 20, 25 minutes of the game,” Klinsmann said. “Then I think nerves settled a little bit.”

Germany’s goal came in the 55th minute after a corner by Mesut Ozil. U.S. goalkeeper Tim Howard did well to punch out a header by Mertesacker but pushed the ball into the path of Mueller, who rifled a shot inside the far post from the edge of the penalty area.

“We clearly dominated the match and we played not a bad game against a top-fit American team,” Mueller said. “I finally scored a pretty goal. I manage it every now and then. We’re all terribly ambitious and this ambition can take us very far, and I try to give my part in each and every match.”

Mueller played despite needing five stiches to close a cut above his right eye sustained in the 2-2 draw with Ghana on Saturday and still visible five days later.

The United States had a chance to level the match in stoppage time, but Alejandro Bedoya’s low shot inside the box was swept away by the sliding Mario Goetze, a late substitute. The Americans won a corner but Clint Dempsey’s header at the far post went high.

The game was emotional for Klinsmann and the five German-Americans on the U.S. team. Germany is coached by Joachim Loew, who was an assistant to Klinsmann when Klinsmann coached Germany to the semifinals in 2006.

“Well, first I asked (Klinsmann) for the result of the other match. I didn’t know that and he also told me they advanced and I told him, I’m happy,” Loew said.

“That is a tough group and the Americans were a bit the outsiders. Everybody considered Portugal a favorite to make it. … (The Americans) really have qualities, they fight, they can run and they really are tough on the opponent. If you beat Ghana, play a draw against Portugal, I think you deserve to make it to the next round.”

The Round of 16 begins with two games Saturday: Chile vs. Brazil and Uruguay vs. Colombia.