European leaders have agreed the next seven-year EU budget after two days of tense talks ended in the early hours.
The UK gives up 10.5bn euros (£7bn) of its rebate, some 20%, while the budget grows to 862.4bn euros, helping to fund the development of new member states.
In return, France has agreed to a budget review in 2008-2009, which could lead to cuts in farm subsidies.
UK Prime Minister Tony Blair said the deal allowed Europe to move forward, avoiding a serious crisis.
Referring to budget commitments to new, mainly east European member states, he told reporters: "If we believe in enlargement, we had to do this deal now."
Mr Blair later told the BBC that had Britain walked away from the compromise deal it "would have wrecked" London's relations with the new EU members and the new German government.
The 2007-13 budget figure agreed represents 1.045% percent of EU output, up from 1.03% in an earlier proposal but still well below the 1.24% sought by the European Commission.
EU BUDGET 2007-13 (EUROS)
Overall spending: 862.36bn
UK rebate down 10.5bn from a total of 50-55bn
Aid to EU newcomers: 157bn (7bn more than the UK at first proposed)
Farm and rural development aid: 292bn
Justice and interior affairs: 10.2 bn
Foreign and humanitarian aid: 50bn
Administrative costs: 50.3bn
Polish Prime Minister Kazimierz Marcinkiewicz, whose country will get 4bn euros more aid than the UK had at first proposed, punched the air and shouted "Yes! Yes!" when the deal was done.
French President Jacques Chirac, long at odds with the British leader over budget, praised Mr Blair's movement on the UK budget rebate.
By accepting the need to "deeply transform" the rebate, he said, Tony Blair had made a "legitimate but politically difficult" gesture.
Though France has agreed to a "full and wide-ranging" mid-term review of the budget, it has the option of vetoing any proposed changes.
German Chancellor Angela Merkel, said to have played an important part in securing the final compromise, greeted the deal as "a good accord for the future of Europe".
Germany, the UK and France, along with all the other wealthier EU countries, are having to increase their contributions to help pay for the 2004 round of enlargement.
The EU leaders also made a qualified commitment to further enlargement, by granting Macedonia the status of EU candidate country.
However, they said further steps, such as the opening of membership talks, would depend on the outcome of a "debate on the enlargement strategy".
BBC Europe Editor Mark Mardell says the deal allows the EU to end the year if not exactly on a high then on at least a success, when yet another crisis was seriously on the cards.
The EU was left in disarray last June when the rejection of the EU constitution in France and the Netherlands was followed by an acrimonious collapse of talks on the budget.
If there had not been a deal at this summit, new member states would not have had time to plan how to use the development aid they become eligible for in 2007, and some of it would have remained beyond their reach.
Tony Blair's grand project was to give Europe a modern budget, refocusing the spending of the European Union so it can face up to the challenges of globalisation rather than subsidising farmers, says Mark Mardell.
He has achieved nothing like that, our correspondent says, not even the certainty that a review will apply to this budget round. But he has ensured that the EU will return to the subject.