Only Britain and the Czech Republic did not sign the new treaty, 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. They also agreed to 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 eurozone 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 to 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 would need a second financial bailout. If it does not sign the pact, it would not qualify to receive assistance under the eurozone's permanent rescue scheme, the European Stability Mechanism.
This vicious circle could have profound implications for a still-fragile eurozone. Ireland is seen as the most successful of the three countries to be bailed out by the eurozone and International Monetary Fund during the sovereign debt crisis.
Perhaps an even bigger uncertainty lies in France, where Socialist presidential candidate François 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 EU leaders. "I am most confident you will succeed."