A deal has been reached on the first constitution for the European Union after hours of talks at the EU summit.
The issue of voting rights pitted big countries against their smaller allies
The final text of the constitution was put to leaders of the 25 EU states, who approved it on Friday evening.
The accord concludes two days of intense negotiations in Brussels and four years of argument and preparation.
Reports say the other sticking point - a new European Commission president - has been postponed for later talks after a bitter row over candidates.
But both Germany and France backed a compromise constitutional draft put forward by Ireland - the current holder of EU presidency.
Now every country will have to ratify the treaty, either in national parliaments or through public referendums.
European leaders toasted the new agreement with champagne, and gave a standing ovation to Irish Prime Minister Bertie Ahern who brokered the deal.
UK Prime Minister Tony Blair said it paved the way for a flexible Europe of strong nation states co-operating together.
"It's a success for Britain and a success for Europe," he said.
French President Jacques Chirac said the agreement meant "an important day for Europe".
Mr Ahern described it as a "win-win solution" which was advantageous for everyone.
"Nobody was rolled over and we worked hard to achieve that," he said.
The document sets out the powers of the national governments of the member states and the EU's various institutions as well as a charter of fundamental rights and a detailed catalogue of how the union will conduct a wide range of internal and foreign policies.
It includes one of the issues that torpedoed constitutional talks last year - resistance by smaller nations to plans for new voting rules.
Jacques Chirac is concerned about the successor to Romano Prodi
The new plan says measures must have the backing of at least 55% of EU states, representing at least 65% of the total population, in order to pass.
Mr Blair said the treaty had satisfied the UK's demands to keep vetoes on issues such as economic policy, defence and foreign affairs.
France had complained that the UK was making too many demands for special treatment.
The UK remains at odds with both France and Germany over a successor to Mr Prodi who steps down as head of the commission when his five-year term ends in October.
France and Germany had backed Belgian Prime Minister Guy Verhofstadt, but Britain opposed him on the grounds that he could be too eager to make the EU more federal.
Mr Verhofstadt later said he was "no longer available" for the post.
A UK commissioner, Chris Patten, had been proposed - but President Chirac said he did not think it was a good idea to have a candidate from "a country which doesn't take part in all European policies".
Mr Patten has now also pulled out, according to Mr Ahern.
The Irish prime minister said he hoped to resolve the issue before his country's presidency ends on 30 June.