Last Thursday night at the Sun Deck bar in Berlin about 50 German soccer fans gathered before a wide-screen television to drink lager and cheer on their favorite team in the Euro 2004 tournament in Lisbon.

It was a scene repeated in pubs all over Germany that evening. But what made it so surprising was that Germany had been eliminated two weeks earlier; these fans were rooting for Greece in its match against the Czech Republic, in part because of Germany's traditional disdain of the Czechs but also because the Greek team has a German coach.

Greece, which went on to a surprise 1-0 victory, plays Portugal Sunday evening in the finals. It will mark the end of an extraordinary month of soccer that has captivated the continent, reigniting nationalistic fervor while reminding Europeans that they do have something in common: their passion for the sport.

On game nights, pubs have been full across Europe, and many public squares have featured billboard-sized television screens. Buses, balconies, cars, pubs and shop windows have sprouted national flags -- unusual for a continent that tends to shy away from displays of patriotic swagger. And even after their national teams have gone down to defeat, crowds throughout Europe keep coming back for more.

All of this comes at a time when the dream of Europe as a united federation is under a cloud. The new constitution negotiated two weeks ago by leaders meeting in Brussels has triggered little public enthusiasm. Polls indicate that people throughout the continent feel alienated from the Eurocratic bureaucracy. Voter turnout in recent elections to the European Parliament dipped below 30 percent in some areas.

"The European elections didn't bring people together," said Charles Grant, director of the London-based Center for European Reform. "But football does."

The European Union seeks to smother national differences and tribal conflicts in a thick cocoon of rules and regulations. But Euro 2004 is all about celebrating those conflicts on the playing field. It is atavistic, blustery, alcohol-enhanced, occasionally nasty -- but ultimately a lot less bloody than the way European nations used to settle their differences.

Author Franklin Foer notes a similar paradox in his new book "How Soccer Explains the World."

"During the nineties, Basque teams, under the stewardship of Welsh coaches, stocked up on Dutch and Turkish players. . . . Everywhere you looked, it suddenly seemed, national borders and national identities had been swept into the dustbin of soccer history." But as he got deeper into the subject, he concluded that soccer globalization often "failed to diminish the game's local cultures, local blood feuds and even local corruption."

In the tournament this year, the underdog is triumphing: Small Europe has humbled Big Europe and new members of the E.U. have defeated old ones. The two finalists, Portugal and Greece, did not enter the union until the 1980s.

Sunday night's match marks the first time the Portuguese have made it to the finals. The country seemed far more enthralled by this prospect than by the news earlier in the week that its prime minister, Jose Manuel Durao Barroso, had been tapped as the new president of the European Commission.

The bigger European states -- Germany, France, Italy and Spain -- all bowed out early from the tournament, with the Germans humiliated by the Czech Republic's second stringers. English fans, who when it comes to soccer seem to possess the fatalistic mentality of Chicago Cubs fans, saw their team limp through to the second round before falling victim to its usual demons.

This being Europe, even nationalistic taunting can show a certain sophistication. When Dutch spectators realized last week that their arch rival Germany would fail to make the tournament's second round, they chanted "Too bad, Germany, it's all over!" -- in perfect German.

But sometimes the bad feelings are less benign. Urs Meier, a Swiss referee who disallowed a goal that would have given England victory over Portugal last week, had to be placed under police protection after receiving 16,000 e-mails, some of them containing death threats, from irate English fans. The tabloid newspaper the Sun had published his personal e-mail address.

A Swiss radio DJ and a local newspaper retaliated by publishing the Sun's phone number. Then the Sun published the DJ's phone number and e-mail address, triggering several thousand nasty messages. Besides using obscene language, DJ Roman Kilschperger told a Swiss newspaper, the messages "usually also mention cuckoo clocks and cheese."

British commentator Rod Liddle says the games allow sports buffs to wallow harmlessly in their deepest national stereotypes: "You see ancient enmities and ancient alliances dating back hundreds of years suddenly reappearing."

Writing in London's Times newspaper, Liddle said, "My enjoyment of Euro 2004 will reach a zenith when I can truly loathe the opposition for their real or imagined character traits of arrogance, deviousness, sexual rapacity, cowardice and duplicity." He went on to attack the French for beignets, haute cuisine, "the unconscionable act of eating horses and garden mollusks [and] the paranoid way in which they attempt to preserve their own ludicrous and doomed language."

The French, in turn, denigrate English fans as "roast beefs" for their unconscionable food preferences and their skin color when exposed to sunlight.

Some 3,000 English fans identified from previous tournaments as potential troublemakers were barred from traveling to Lisbon for this year's event. But a few hundred fans who did go managed to drink themselves into a state of aggression after England narrowly lost to France two weeks ago.

Early the next morning they ran amok in the resort town of Albufeira, a mile-long strip of bars, chanting "Eng-er-land!" and hurling plastic chairs, beer cans and glasses at Portuguese police. Fifty-three were arrested, and many were processed, fined and shipped home within 24 hours.

But even in the new integrated Europe, the process has not always been smooth. When Barry Mann, the reputed riot leader, was sent back to England to serve a two-year sentence, the authorities let him go on a technicality.

As usual for England, the tournament ended in tears. The team jumped out to a quick one-goal lead in its crucial match against Portugal last week. Then 18-year-old wunderkind Wayne Rooney had to leave after 17 minutes of play with an injured foot and slowly but surely England's spirit withered. Portugal triumphed after David Beckham, perhaps the continent's highest paid sports celebrity, missed an easy shot in a penalty shootout at the end of a regulation time.

"Somewhere in the soul of England, closer to the surface than we might like to accept, is the absolute conviction that we are natural born losers," lamented Matthew Norman in the Evening Standard newspaper.

Other nations seemed less haunted. As the Czech Republic's scrappy squad battled its way to the semifinals, fans back home celebrated each triumph. But when the team lost to Greece Thursday, the mood remained friendly. "Believe it or not there's a fairly sizeable Greek community in Prague and a lot of Czech fans went into the Greek pubs and congratulated them on winning," said Michal Rezanka, a Web site designer in Prague. "A lot of people cried, but sometimes losing with dignity is more important than winning."

Special correspondents Shannon Smiley in Berlin and Kimiko de Freytas in Paris contributed to this report.

Fans of the Greek soccer team get ready for their semifinal match Thursday against the Czech Republic in Porto, Portugal. Greece went on to the finals after an upset victory. Portuguese fans saw their team advance to the Euro 2004 finals for the first time with its victory over the Netherlands on Wednesday. The Portuguese team plays Greece on Sunday.