By John O'Donnell
BRUSSELS, March 2 (Reuters) - All but two European Union countries signed a treaty on tighter budget discipline for the euro zone on Friday, marking a coup for Germany which pushed for the accord to try to prevent a repeat of the loose spending that led to debt crisis.
Only Britain and the Czech Republic did not sign the "fiscal compact", under which countries in the euro zone are bound to write a 'golden rule' on balanced budgets into their national constitutions or equivalent laws, with 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.
The fiscal compact will be legally binding as an international agreement and will enter into force following ratification by at least 12 of the 17 euro area member states.
It will only apply to those contracting parties whose currency is the euro, while the others will be bound by its provisions once they adopt the currency or at an earlier date if they so choose.
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."