The U.S. soccer team outshot and outplayed the taller, stronger Germans in their World Cup quarterfinal match Friday, but they just couldn't connect with the goal. 

Germany's Michael Ballack scored on a header in the 39th minute, giving his nation a 1-0 lead that the United States, despite several good shots, couldn't equalize. 

The U.S. team will be flying home, while Germany advanced to the next round.

Until the goal, the Americans had dominated the three-time champions, outshooting them 5-1. Germany goalkeeper Oliver Kahn twice made diving stops on Landon Donovan and made a tough save on Eddie Lewis. 

In the 1998 Cup, Germany manhandled the Americans during a 2-0 first-round victory in Paris. This time, the U.S. players shoved back. 

A shot by Eddie Lewis bounced off Kahn and hit off the left hand of defender Torsten Frings, who was standing on the goal line. Scottish referee Hugh Dallas didn't call a penalty, awarding Germany a goal kick. 

Then, with minutes left in the game, defender Tony Sanneh just missed a goal on a header, hitting the side of the net off a cross from Clint Mathis, who had entered early in the second half. 

Moments later, Mathis' hard shot in the penalty box was blocked by Jens Jeremies as the Americans tried desperately to score the tying goal. 

At the end of the game, half a dozen players from each team collapsed to the ground, exhausted. 

The fans gave the Americans a standing ovation, and captain Claudio Reyna held up a U.S. flag, saluting the crowd to cheers of "U-S-A! U-S-A!" 

"We can go home with our heads held high," U.S. goalkeeper Brad Friedel said. 

The fast-paced game also featured a lot of physical play, with hard tackles from both teams. 

Reyna even got some payback on Jeremies, the German midfielder who kneed him in the back early in the game four years ago. 

Jeremies entered as a substitute in the 60th minute, and eight minutes later he and Reyna pushed each other as the Americans prepared to take a free kick near the German goal. Both tumbled and Reyna stomped on Jeremies' left leg as they got up, earning a yellow card. 

Despite the loss, it was a stellar showing for an American team that many thought would struggle just to get out of its first-round group four years after it finished last in the 32-nation field. 

This World Cup started better right away. The Americans opened with a 3-2 win over heavily favored Portugal, then tied 1-1 against South Korea — which hasn't lost yet. While they lost 3-1 to Poland, they backed into the second round and upset Mexico 2-0. 

But instead of the Americans advancing to the semifinals for the first time since the first World Cup in 1930, the Germans will go there for the 10th time — their first since winning their last championship in 1990. 

Germany will play the winner of Saturday's quarterfinal between Spain and South Korea. 

The Associated Press contributed to this report.