European Union leaders have hailed the historic agreement on the EU's first constitution, reached after intense negotiations by the 25 member states.
Jacques Chirac is concerned about the successor to Romano Prodi
"This is a win-win solution," said Irish Prime Minister Bertie Ahern, who steered the Brussels talks to success.
But EU governments now face the task of ratifying the text; several, including the UK, are to hold referendums.
A deal was reached after protracted wrangling over national veto rights and the voting powers of the member states.
UK Prime Minister Tony Blair said the treaty 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.
Under the new voting rules, measures must have the backing of at least 15 EU states, representing at least 65% of the total population, in order to pass.
The new arrangements mean smaller member states - mostly the new eastern European nations which joined in May - cannot be simply overruled by a small but powerful group of older members, such as France, Germany and the UK.
A bitter row over the new voting rules had torpedoed constitutional talks last year.
The issue of a new European Commission president has been postponed for later talks, after a row over candidates.
Mr Ahern hailed the new constitution as "a fundamental advance for Europe" - and received a standing ovation from other leaders for devoting Ireland's six-month EU presidency to achieving a deal.
"We've now adopted the constitutional treaty politically; the time starts now to explain it to the public, to sell it and to ratify it," outgoing European Parliament president Pat Cox said.
In many cases, this may be an uphill task. The BBC's political editor, Andrew Marr, says the results of this month's European elections ought to have been a rude blast in the ear for the politicians about how bored and contemptuous many ordinary voters have become about the EU.
But European leaders, toasting the new agreement with champagne, were keen to sound upbeat.
Mr Blair said it paved the way for a flexible Europe of strong nation states co-operating.
National veto remains for foreign policy, defence and taxation
New system of voting weights ends row over Nice system
EU to have president, instead of six-monthly rotating presidency
EU to have foreign minister
"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".
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.
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.