EU leaders in Brussels have reached agreement on what has become known as the Reform Treaty - the successor to the draft European constitution. There were lots of demands by individual nations - there are after all 27 of them now - but it was a compromise over a new voting system, demanded by Poland, which in the early hours of Saturday morning finally facilitated the breakthrough.
Poland's demand for a radical rethink of the voting system was dealt with by a compromise which delays the new rules. What's known as a "double majority" system will be phased-in beginning 2014 and fully implemented three years later. Under this system, a 55% majority of EU countries with at least 65% of the bloc's population will be required for any decision to be taken. There was a universal praise for the diplomatic skill of German Chancellor Angela Merkel, who steered the summit to its conclusion. And despite tensions with Poland along the way - at the end she said the deal was good for the EU and good for Poland.
There's no doubt the summit was a bruising one for relations between Poland and the EU. Warsaw both applied pressure and came under pressure from other states for its hard line. Not long before the deal was reached the President of the European Parliament Hans Georg Pöttering warned Poland it was not winning any friends.
After the compromise Poland said it would improve its cooperation with its European allies but maintained the tough posture had improved its position in the EU. President Lech Kaczynski said "after today Poland is capable of much better cooperation with France Britain and also Germany - because we experienced solidarity"
. He said "if solidarity will be required from Poland, we will show it"
. Polish Foreign Minister Anna Fotyga dismissed suggestions that the hard bargaining would worsen an already tarnished image in the EU. She said "our position is enhanced after this summit"
. "I am sure the heads of state are accustomed to this kind of negotiation, they value hardcore negotiations."
Some of the other interesting aspects of the treaty; it will create a full-time president who will lead the Council of Ministers, replacing the current system where members take six-month terms