By John O'Donnell
BRUSSELS (Reuters) - All but two European Union countries signed a fiscal pact to tighten budget discipline on Friday, marking a coup for Germany that pushed for the accord to prevent a repeat of the loose spending that led to economic crisis.
Only Britain and the Czech Republic did not sign the agreement, under which all other countries in the 27-nation bloc are to write a golden rule on balanced budgets into national constitutions or equivalent laws and automatic correction mechanisms if the rule is breached.
"This stronger self-constraint ... as regards debts and deficits is important in itself," said Herman Van Rompuy, who as President of the European Council played a key role in negotiating an agreement acceptable to all signatories.
"It helps prevent a repetition of the sovereign debt crisis," he said, in a speech given during the signing ceremony.
But the agreement could yet pose significant difficulties.
Ireland, which depends on the euro zone for financial support after its banking system collapsed, will hold a referendum on whether it should be party to the pact, a vote the country's finance minister has compared with asking the nation whether it wants to remain inside the euro currency bloc.
Irish voters have rejected new European laws in referendums in the past. But if they were to do so again in a plebiscite expected by June, it could ruin plans to return to borrowing on financial markets next year and regain financial sovereignty.
This in turn would most likely mean the country needs a second financial bailout. If it does not sign the pact, however, it would not qualify to receive assistance under the euro zone's permanent rescue scheme, the European Stability Mechanism.
This vicious circle could have profound implications for a still fragile euro zone. Ireland is seen as the most successful of the three countries to be bailed out by the euro zone and International Monetary Fund during the sovereign debt crisis.
Perhaps an even bigger uncertainty lies in France, where opposition Socialist presidential candidate Francois Hollande has vowed to renegotiate the treaty to add measures to promote growth if, as opinion polls suggest, he defeats conservative President Nicolas Sarkozy in a May runoff.
Van Rompuy underscored the importance of EU leaders carrying their parliaments and electorates with them.
"You now all have to convince your parliaments and voters that this Treaty is an important step to bring the euro durably back into safe waters," he told heads of state. "I am most confident you will succeed."
(Reporting By John O'Donnell, editing by Mike Peacock)