EU members which use the euro have agreed to a tax and budget pact to tackle the eurozone's debt crisis.
But a German and French attempt to get all 27 EU states to back changes to the union's treaties was dropped after objections from the UK.
Prime Minister David Cameron had insisted on an exemption for the UK from some financial regulations.
Instead, eurozone members and others will adopt an accord with penalties for breaking deficit rules.
The new tougher rules on spending and budgets will now be backed not by an EU treaty but by a treaty between governments. It will be quicker to set up but it may prove less rigorous, says the BBC's Europe editor Gavin Hewitt in Brussels.
But, he says, Europe has taken a big step towards closer integration, with binding rules over tax and spending, and sanctions against countries that overspend.
European Council President Herman Van Rompuy said the leaders of 26 countries had indicated a desire to participate, pending consultation with their parliaments.
There is now a two-speed Europe - after this long night, the French president accepted that.
There is, too, considerable antagonism towards Britain - it used its veto in what is seen in Brussels as Europe's hour of need.
What is unclear is whether European institutions can be used to implement a treaty between governments.
If EU officials are in the room, David Cameron has already laid down a marker that he expected the UK to be involved. It is all a recipe for further tussles.
The big question is what effect all this will have on the eurozone crisis. The main impact will lie in the long-term - the agreement has little to say about the debt mountains and the absence of growth in most of Europe.
Mr Cameron said he had not signed up to the deal because, he said, it was not in Britain's interests.
"Those countries that sign this treaty... we wish them well because we want the eurozone to sort out its problems, to achieve that stability and growth that all of Europe - Britain included - needs," he said.
EU leaders aim to have the pact ready to take effect by March.
Among the measures agreed on, leaders pledged to provide more money for the International Monetary Fund (IMF) to fund bailouts.
IMF chief Christine Lagarde welcomed the deal as "a really good step in the right direction".
But the announcement from Brussels failed to lift the markets, which are still hoping for more intervention by the European Central Bank (ECB), and European stocks traded slightly down on Friday.