European Union leaders agreed the first ever cut in the bloc's budget after all-night talks driven by sharp differences over priorities for the next seven years.
"Deal done!" summit chair and EU President Herman Van Rompuy said on Twitter after more than 24 hours of tough talks between the bloc's 27 heads of state and government.
"There's a lot in it for everybody", he added a short time later, while emphasising that the 2014-2020 austerity budget embodied "a sense of collective responsibility from European leaders."
Pushed by British Prime Minister David Cameron, who said the EU could not increase spending while many of its members were forced to slash their national budgets, leaders agreed a cut of around three percent compared with the 2007-13 budget.
"Every previous time these multi-year deals have been agreed, spending has gone up. Not this time," Cameron said.
It was "a good deal for British taxpayers", he said, adding that for a growing eurosceptic audience at home, it also "shows that working with allies, it is possible to take real steps towards reform in the European Union."
The British leader's stance had put him on a collision course with countries such as France and Italy, which wanted increased EU investment to boost growth and curb record unemployment.
French President Francois Hollande nonetheless deemed the final figures on the bloc's budget "a good compromise."
"It was an agreement that as usual was long to produce, but which I believe is a good compromise," he said.
Significantly, the EU's farm support programme, of which France is a major beneficiary, and Cohesion Funds, used to help new member states catch up with their peers, were not cut further from figures Van Rompuy submitted to a failed summit in November.
German Chancellor Angela Merkel said the deal "was worth the effort" and she "was glad that everyone showed the needed willingness to compromise."
Greek Prime Minister Antonis Samaras was also upbeat, and said his country would receive more than 16 billion euros from the budget.
"We are extremely pleased, because we managed to achieve the best (result) possible," Samaras said in a statement.
Greece obtained "much more, even, than what seemed realistically feasible at the beginning of the negotiations," he added.
Under the accord, 2014-20 actual spending, or "payments" in EU jargon, was set at 908.4 billion euros ($1.2 trillion), with an absolute ceiling of 960 billion euros for spending "commitments" to the budget.
That is just one percent of the bloc's gross domestic product (GDP) and is less than the figure of 973 billion euros that Cameron and allies such as the Netherlands had rejected in November.
In the EU budget process, commitments refer to the maximum amount that can be allocated to programmes, while actual spending or "payments" is usually lower because projects are sometimes delayed or dropped.
Originally, the European Commission had sought a 5.0 percent increase in commitments to 1.04 trillion euros ($1.4 trillion).
The final agreement, however, is only part of the battle because there is another important hurdle to clear -- the European Parliament must approve the budget, and lawmakers are in no mood for austerity.
Since late 2009 the parliament has acquired more decision-making powers within the EU, must now live up to its responsibilities and approve the budget, Van Rompuy said.
But the heads of the four largest groups in Parliament, which is to vote on the budget in July, said they could not accept it in its current form as it would not help boost the struggling EU economy.
"The real negotiations will start now with the European Parliament. We will maintain our priorities which we have clearly stated many times," they added.
Cameron, who last month risked isolating himself by proposing to hold a referendum on Britain's membership of the EU, had insisted Thursday that the budget figures be cut.
"When we were last here in November, the numbers that were put forward were much too high. They need to come down -- and if they don't come down, there won't be a deal," Cameron had said.