Even as millions in Germany celebrated their team's hard-earned win over Poland, police in Dortmund, the game's venue, had their hands full after German and Polish fans clashed there.
Trouble flared up ahead of the game in Dortmund
Police detained more than 300 people in the western German city of Dortmund on Wednesday following clashes ahead of the World Cup Group A match in the worst outbreak of violence since the tournament got underway.
German fans threw bottles, chairs and fireworks at police as they tried to move fans out of the center of the city and riot police then chased several dozen fans through the city.
Police said those detained included 120 hooligans already known to authorities and around 60 Polish fans. In separate clashes nearby, smaller groups of drunken German and Polish fans brawled and set on each other.
Some of the Poles were carrying potentially dangerous items, and others were on a list of known hooligans. Police said some people had been hurt by the missiles thrown, but no one had been seriously injured.
"Not a good mood"
The Germany-Poland match had been identified by organizers as a security risk because of clashes last November between about 100 German and Polish supporters near the border.
Hooligans brawled during a league game in Poland last May
The relationship between the two countries, and especially soccer fans, has been marred by trouble and historical tensions, and police were on the alert as ten of thousands of fans from both nations descended on Dortmund to watch their teams play.
"Expectations of trouble proved self-fulfilling and made things very difficult for police," said Dortmund police chief Hans Schulze.
"We needed people on almost every corner today as the potential for aggression was so high … there was not a good mood in Dortmund today," he added.
News agency Reuters reported that the atmosphere in Dortmund was largely friendly and peaceful to start with, but took on a menacing note as a group of German skinheads drinking in the city center began to behave threateningly.
"What surprised us was the sheer number of fans who showed themselves ready to turn aggressive," said Schulze. He added that not all the aggressive fans were known hooligans, but rather that vast quantities of alcohol had played a major role in the escalation of violence.
"We had hooligans here but they did not attack each other. Rather we had extremely drunk fans who set on police and then on each other."
"We're going to Berlin "
Despite the violence, nothing, it seemed, could spoil the jubilant mood in Germany as millions erupted with joy when Oliver Neuville finally scored in the dying minutes of a fast-paced and emotionally-charged game that had fans on edge after a long list of missed chances for both sides.
The last gasp goal books Germany a berth in the second round of the tournament while Poland head home, having lost 0-2 earlier to Ecuador.
Ambitious German fans celebrate in Dortmund with an oversized model of the World Cup trophy
Most of Germany celebrated the win with loud honking, flag-waving, partying and chants of "Berlin, Berlin, we're going to Berlin," in an ambitious reference to the team's eventual passage to the finals. In several cities, the celebrations led to clogged roads and chaotic traffic jams.
More than 500,000 fans are estimated to have gathered at the so-called "fan mile" near Berlin's historic Brandenburg Gate, while some 70,000 people celebrated the victory at public fan areas in both Stuttgart and Hamburg.
"A big psychological lesson"
The good mood was also apparent in the German national team camp. Coach Jürgen Klinsmann said Germany were a match for anyone at the World Cup.
"There are so many great teams at this tournament but we can compete with all of them," Klinsmann told reporters after the triumph.
An ecstatic Oliver Neuville after his goal
"This was a big psychological lesson for us tonight. The players went at it for 90 minutes and even when we hit the crossbar twice in the last minute, I still felt we were going to score," Klinsmann said. "The team never lost faith and they forced the goal in the end. You could see tonight this team keeps going right until the end."
Substitute Oliver Neuville, who scored the clincher, was matter-of-fact about his feat.
"Clearly I was a bit lucky, but I think it was well earned. Now we want to win the next match (against Ecuador) and be first in the group."