European leaders say they are satisfied with the deal reached on the EU budget, after two days of tense talks.
French, Swedish and Polish leaders praised UK Prime Minister Tony Blair, who led negotiations, after he secured agreement on a budget of 862.4bn euros.
Mr Blair gave up 10.5bn euros (£7bn) of the UK rebate, some 20%. A farm subsidy reduction will be considered in 2008.
But there was criticism from national opposition parties and the European Parliament, which wants a higher sum.
Mr 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."
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.
France has agreed to a "full and wide-ranging" budget review in 2008-2009, which could lead to cuts in farm subsidies, though it has the option of vetoing any proposed changes.
'Not the end'
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".
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
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 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 EU's executive arm, the European Commission.
It was also less than the 883bn euros demanded by the European Parliament.
Parliament head Josep Borrell said the agreed figure was just the "position" of EU leaders, and still had to be endorsed by the parliament and the European Commission.
"This agreement... is not the end of the process. It marks the beginning of the last phase of negotiations," he warned.
In the UK, Mr Blair faced criticism from the opposition and some of the press for giving up part of the rebate (worth 5.7bn euros this year) secured for Britain in 1984 on the grounds that it was paid little in the way of farm subsidies.
"Seldom in the course of European negotiations has so much been surrendered for so little," said opposition Conservative Party foreign affairs spokesman William Hague.
"It is amazing how the government has moved miles while the French have barely yielded a centimetre."
Mr Blair 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.
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.
But Tony Blair has not achieved his grand project - to modernise the budget and focus it more on the challenges of globalisation rather than subsidising farmers, says our correspondent.