By Stephen Mulvey
EU reporter, BBC News, Brussels
Leaders were delighted with the compromise
European Union leaders have reached a late-night deal in Brussels which promises to give the bloc a newly-signed treaty by the end of the year.
The treaty is set to include most of the main points of the failed constitution, such as:
a full-time president of the European Council - the regular gatherings of prime ministers and presidents
a new foreign affairs chief, with the profile and the budget to give the EU more clout on the world stage
- fewer national veto powers
- a voting procedure that lowers the threshold for approval, and matches country's voting strength to population (phased in between 2014-2017)
- more powers for the European Parliament
- a slimmed-down European Commission (from 2014)
Actually this will be not one new treaty, but amended versions of two old treaties - a necessity for countries seeking to avoid a referendum.
But both critics and supporters of the project agree that 95%, or even 99%, of the impact of the constitution has been preserved.
"Effectively we have everything that we need to strengthen the capacity of the European Union to act," says British Lib Dem MEP Andrew Duff, who helped to draft the original constitution.
The policy areas seeing the biggest changes are foreign affairs - where the new chief, to be styled the High Representative, is expected to make a big difference - and justice and home affairs.
In this area, the national veto has been abandoned, and the commission, parliament and European Court have acquired new powers, though the UK has won the right to opt in or out.
The new arrangements will also mean that the threat of big delays for new members seeking to join the Union has been partially lifted.
The test of this will be Croatia, which is keen to join in 2009, the year most of the treaty amendments come into force.
But none of these changes are yet a foregone conclusion.
The leaders in fact came to Brussels for this summit determined to do everything to pre-empt calls for referendums, following the experience of 2005
Formally, what the summit has done is agreed a mandate for an intergovernmental conference, which it is hoped will start work this summer deciding precise texts of the amended treaties.
The mandate appears to settle the most sensitive questions in advance, so there is an expectation that the conference will be short and sweet - though there is no guarantee of this.
And then there is ratification.
The biggest unknown is: Which countries will hold referendums?
Ireland definitely, Denmark possibly. There is also a chance that the Netherlands - one of the countries which scuppered the constitution in a referendum in 2005 - will hold another vote.
The decision has been left in the hands of Dutch judges.
The other 24 member states are expected to opt for the simpler option of parliamentary ratification - though some observers say the British House of Lords may not be very willing to play ball.
The leaders in fact came to Brussels for this summit determined to do everything to pre-empt calls for referendums, following the experience of 2005.
Poland has some breathing space where it comes to vote counting
This has left a bad taste in some mouths.
"It's much worse than the usual European stitch-up," says writer on European affairs Kirsty Hughes, a firm believer in European integration.
"It's essentially the same as the constitution, but many leaders are trying to sell it as something different, in order to avoid a vote. It's a collective lie."
Jacki Davis, communications director of the European Policy Centre, is less harsh.
In her view, the original constitutional treaty was more of a treaty than a constitution, and the changes now agreed have removed even what constitutional trappings there were.
But she still sees a problem.
"Here is a treaty that looks quite like the old one and this time we are not going to give them a say," she says.
"The big challenge for the EU in future is to involve the public in a debate over Europe to make them feel their voice can be heard. Europe cannot go on being an elite-driven project."