When the Nazis retreated across the Danube River to this town two days before Christmas 1944, they blew up the three middle sections of the Maria Valeria Bridge to slow the Soviet army's advance behind them.

For 55 years since, impervious to both Communism rule and its fall, the pylon stumps of the ruined bridge have sat in the middle of the Danube, the last such relics of World War II, but also, more bitterly, testaments in stone to the antipathy between Hungary and Slovakia.

"The bridge is the shame of both nations," said Tamas Neggyes, 33, acting mayor of the historic castle town of Esztergom, which faces economically depressed Sturovo from the Hungarian bank of the river like a dowager looking down from her suites.

But now, in one of the more telling symbols of central Europe's democratization and its steady integration into the institutions of Western Europe, the bridge will be rebuilt with funding from the European Union and the Slovak and Hungarian governments.

When the wrought-iron structure is completed sometime in the next two years it will look almost exactly like it did when it was built in 1896 and named after a Hapsburg princess--an architectural choice that might make little economic sense but one that people on both sides of the river view as entirely fitting.

"The bridge demonstrated our inability to come to terms with the past," said Ladislav Fekete, deputy mayor of Sturovo, a town whose population of 12,000 is 68 percent ethnic Hungarian. "Its reconstruction is the very best measure of our future together in Europe."

Borders have shifted violently here in the last 100 years, stoking nationalist resentments of which the bridge was merely a symptom. Before World War I, the territory on both sides of the river here was part of the Austro-Hungarian Empire, but the 1920 Treaty of Trianon dismembered a vanquished Hungary. Seventy percent of its territory was ceded to the newly created states of Czechoslovakia, Romania and Yugoslavia, and 60 percent of its population found itself living beyond the borders of the new Hungarian republic.

Hungary, which allied itself with Nazi Germany, reclaimed lost territory in World War II only to lose it again when the war ended, and the status of ethnic Hungarians within neighboring countries has been a repeated source of political tension in the region.

Hungary and Czechoslovakia were members of the Soviet-led Warsaw Pact military alliance, but fraternal socialist ties were never enough to overcome distrust, and the bridge was not rebuilt despite occasional mumbling that the issue was being discussed by Communist officials.

Moreover, Esztergom, 29 miles northwest of Budapest, is the "Hungarian Rome," and the Czechoslovak Communist authorities had no interest in facilitating the journey of pilgrims to the town's massive neoclassic cathedral on Castle Hill.

When Communist rule ended in 1989, committees formed on both sides of the river to encourage reconstruction of the bridge. But following Czechoslovakia's peaceful division in 1993, Slovakia's leader, Vladimir Meciar, introduced an authoritarian, xenophobic style of rule that severely hampered the new nation's chances of joining NATO and the EU. Meciar's government also displayed scorn for the rights of the 11 percent of the country's population that is ethnic Hungarian. So the bridge continued to rot. Indeed, one of Meciar's coalition partners declared that the bridge should not be rebuilt because it would be crossed first by Hungarian tanks invading Slovakia.

Meciar was voted out of office in 1998, replaced by a Western-leaning coalition that has put the country back on track for EU membership. And last fall, the prime ministers of Hungary and Slovakia met in the middle of the Danube to sign an agreement to rebuild the bridge.

"I think it's good for both communities," said Anna Babindia, 44, a Slovak resident of Sturovo. "We can start to rebuild relations again."

The $20 million bridge will be a narrow two-lane span, sloping into the heart of both towns. Local officials have long-range plans to build a bigger bridge skirting the towns to handle a projected increase in traffic as the regional economy grows, but they said that for the sake of historic reconciliation, the Maria Valeria had to be rebuilt.

"This is not just about a bridge or two separated communities," said Neggyes, whose town has 30,000 residents. "It's about the relations between two countries."

Since the 1970s, a small tugboat towing a floating platform has ferried residents and cars on the seven-minute crossing between the two towns about a dozen times a day. It's inconvenient, bitterly cold in winter and seldom used. The mayors of the two towns hope the bridge will spark trade and economic growth, particularly in Sturovo, which has a 25 percent unemployment rate.

Istvan Bindics, 53, has been the ferryboat captain for 30 years and is not worried about joining the ranks of the unemployed. He said he is planning to retire when the bridge is built, but he added with a smile that he is skeptical that will be any time soon.

"For Hungarians on the Slovak side, the bridge was an umbilical cord to the mother country," he said. "That made it a political issue. And it's still a sensitive issue on the Slovak side. Every journalist who comes here asks if I'm worried about losing my job. I'm touched by their concern, but they shouldn't worry about me. I won't believe in the bridge until I see the bridge."

CAPTION: Sturovo Deputy Mayor Ladislav Fekete, standing by the bridge, says its ruins "demonstrated our inability to come to terms with the past."