EU leaders were set early this morning to agree a Treaty of Nice, opening the way for an historic enlargement to the east by changing the way decisions are made and shifting influence towards the larger states.
Although the leaders had still not reached a final agreement, the Taoiseach, Mr Ahern, was able to claim a "major victory" for Ireland on the issue of taxation after all references to subjecting tax policy to qualified majority voting were removed from the text.
More than 24 hours after they were due to leave the French resort city of Nice, the leaders were engaged in what Mr Ahern described as a "battle royal", attempting to resolve the last, most stubborn disputes over the relative voting weights of member states on which hang hugely sensitive questions of national prestige.
And, early this morning the French Presidency added to the drama by proposing for the first time the election of the President of the Commission and his team by qualified majority vote.
The move was an unsuccessful bid to buy off Belgian anger over attempts to decouple their vote in the Council of Ministers from parity with the Dutch. Belgium has long borne a grudge over the blocking by the British in 1994 of their candidate for the presidency, Mr Jean Luc Dehaene.
The disputes over the weighting of votes still threatened to prevent agreement on the final package last night and a Government spokesman stressed that "nothing is agreed until everything is agreed".
The spokesman said the Taoiseach had fought the taxation issue on the basis of sovereignty, arguing that tax policies should not be imposed against the wishes of citizens. He added that Ireland was satisfied that military missions could only be pursued by the entire EU and not by a sub-group of member-states.
The European Parliament's representative at the summit, Mr Elmar Brok, described a failure to move towards qualified majority voting on tax as "just a disaster".
Ireland retreated on the question of the future size of the European Commission, accepting a proposal to limit the number of commissioners once the number of EU member-states reaches 27. From then on, the size of the Commission will be capped and a system of equal rotation will determine which member-states will appoint commissioners.
Although most delegations were predicting success last night, the atmosphere in Nice remained tense with the Belgians threatening to walk out of the talks.
The re-weighting of votes in the Council of Ministers benefits the bigger member-states, which see their votes multiply by three, while most smaller states double their votes. A new clause requires that decisions must have the support of member-states representing at least 62 per cent of the EU's population. This means that Germany, which is the most populous state in the Union, will need the support of just two other large states to block any measure.
In a reform of the European Parliament, Ireland is likely to lose three of its 15 MEPs but a Government spokesman claimed this reduction was significantly smaller than expected.
The Taoiseach could claim a further success in blocking a legislative approach to social dialogue in the workplace that the Government argued would threaten Ireland's voluntarist model of social partnership.
After four days of fractious negotiations, amid accusations of arrogance on the part of the French Presidency, Commission sources expressed concern that the Treaty may fail to break the gridlock in decision-making.
Commission sources say that unless there is a substantial extension of qualified majority voting in both areas, the EU will be severely handicapped.
Proposals from the summit should be subjected to a referendum, Fine Gael and the Green Party said last night. Fine Gael also expressed concern that there had been a "substantial dilution" of Ireland's voting strength on the European Council.