The EU has agreed a new framework budget for 2007-2013 after months of tense negotiations.
The UK's rebate continues to be a controversial EU issue
BBC News considers how the disagreements over future financing were overcome at the summit of EU leaders on 15 and 16 December.
What were they arguing about?
It was all about how much the EU will spend between 2007 and 2013, how the money will be spent, and which countries will provide the funds.
The UK was under pressure to agree to cuts in its rebate, and was in turning trying to keep open prospects of cuts to the Common Agricultural Policy before the end of the seven-year period. The issue of how much development aid the new member states should get, was also central.
The 2007-13 budget is formally known as a financial perspective. It places limits on spending in each of the EU's policy areas for each of the seven years - but a detailed annual budget still has to be agreed every year.
What was the deal they reached?
The overall size of the budget is half way between the figure the UK EU presidency first proposed and the Luxembourg EU presidency proposed in June.
To be precise, the UK proposed 1.03% of the EU's combined gross national income, Luxembourg proposed 1.06%, and the final deal was 1.045%. Reportedly this figure was first suggested by the German Chancellor Angela Merkel.
In euros, it comes to 862.36bn over the seven years.
The UK at first suggested a big cut in development aid to the new member states, by comparison with Luxembourg's proposal, but the 10 new countries clawed 7bn euros of this back during the negotiations.
The UK also gave up 10.5bn euros of its rebate, about 20%. In return it got agreement on a wide-ranging review of EU spending in 2008-9, which could theoretically lead to cuts in farm spending.
Did France get everything it wanted?
France did not want to allow even the possibility of a change to farm spending before 2014. The agreed wide-ranging budget review does leave open this possibility - though France will have powers of veto over any action taken in the light of the review.
French contributions to the EU budget will also reportedly rise more sharply than Britain's, under the deal that was struck.
Beyond the budget itself, France had also hoped the summit would agree lower rates of VAT for French restaurants, and was uneasy about granting candidate status to Macedonia. But no deal was done on VAT, and Macedonia did get candidate status.
Why was the UK under pressure to give up its rebate?
When the UK won the rebate in 1984 it was one of the poorest countries in the EU, but now it is one of the
The main reason for granting the rebate to the UK was the fact that it receives only a small share of CAP funds. That is still the case, but it is also true that the amount of the budget spent on agriculture has declined from 70% to 40%. Nonetheless, the UK argues that the rebate is fully justified until the CAP undergoes major reform.
All other member states have to contribute towards the rebate, even the poorest - a situation that many regard as unfair. The lion's share is paid by France and Italy, which naturally resent it. There are also other major net contributor countries, such as Germany, the Netherlands and Sweden, which ask why the UK gets a rebate when they do not.
Which countries were winners/losers?
There is no easy answer to this question.
The 10 new member states will benefit from billions of euros of development aid between 2007 and 2013, so in a sense they are obvious winners. On the other hand, they will be getting less than Luxembourg proposed in June 2005.
The UK has sacrificed part of its rebate, but the UK government said it had to do this in order to pay its fair share of the costs of enlargement. And even though it has given up more of the rebate than it originally wanted to, it has engineered a situation where the UK, France and Italy will be making a roughly equivalent net contributions to the EU budget from 2007 onwards. In the past, the UK's net contribution has been much higher.
It will take a while for all the figures in the budget to be fully digested. A number of countries were handed sweeteners of one kind or another, but it is not immediately clear how they affect each country's overall contribution to the budget.
Is there any prospect of change to the CAP?
No, not much, unless this comes about as a result of the mid-term review.
The budget does, however, say that there will be no new money to pay farm subsidies to Romania and Bulgaria when they join the EU in 2007 or 2008. This will inevitably lead to a reduction in the subsidies paid to the existing 25 members.
Correspondents say that while there is no guarantee that the mid-term review will lead to changes in the CAP, it will at least ensure that the arguments continue.
Also, the new French president elected in 2007 may possibly be more sympathetic to the idea of reorienting the EU budget away from farm subsidies, towards measures intended to stimulate economic growth.
While the UK has given up part of its rebate, it has held on to the majority of it, and will use this as leverage to win concessions on the CAP another day.
How important was it to reach agreement at this summit?
It was quite important, for a number of reasons.
The new member states were the most desperate for a deal. They need to start planning how they will spend the development aid they will be eligible for in 2007. The longer the delay, the less money they will, in practice, be able to access.
For the UK, it was important to crown its six-month presidency of the European Union with a success. Without it, many critics would have branded the whole presidency a failure.
The EU as a whole also needed a success to dispel a sense of crisis created by the rejection of the EU constitution by French and Dutch voters in mid-2005, and the bitter disputes over the budget that marred the last major EU summit in June.
Will the budget now automatically become law?
No. It still has to be passed by the European Parliament, which favoured a higher overall spending level. Negotiations between EU governments and the parliament will start in January, under the Austrian EU presidency.
The two main political groups in the parliament, the centre-right European People's Party (EPP), and the Socialists, have been non-committal.
EPP leader Hans-Gert Poettering said the deal was a good basis for negotiations. The Socialists, in their first response, said it was "not ambitious enough" but better than no deal at all.