The agreement on the reform treaty, reached by prime ministers and heads of state after hours of wrangling in Lisbon, should put an end to a prolonged institutional debate sparked by voters in France and the Netherlands, who in 2005 referendums rejected a European constitution.
"This is a victory for Europe. We are getting out of a blind alley. We no longer have an institutional crisis," said Portuguese Prime Minister Jose Socrates, who as holder of the EU rotating presidency was acting as the meeting's host.
The treaty is designed to streamline the EU's decision-making process following its "big bang" expansion of 2004, which welcomed 10 new member states into the 50-year-old organization.
It is also set to improve the EU's global diplomatic clout by simplifying the way it relates with international partners.
'Historic agreement' for the 21st century
"This is a historic agreement. Now Europe can defend its interests in the age of globalization," said a visibly pleased Jose Manuel Barroso, head of the EU's executive arm, the European Commission.
"In this case we're really talking about an agreement which really gives the European Union a capacity to act in the 21st century," he added.
The text is now due to be signed on Dec. 13 in the Portuguese capital by EU prime ministers and heads of state and will thereafter come to be known as the Lisbon Treaty.
Once officially sealed, it will need to be ratified by all member states, by either parliamentary votes or referendums -- meaning its implementation is far from assured.
EU officials are nevertheless hopeful that the ratification process will be completed by spring 2009, when European Parliament elections are scheduled.
"This is a good treaty for the Union," said Luxembourg Prime Minister Jean-Claude Juncker, the EU's longest-serving leader.
The impasse was resolved after leaders agreed to give in to demands from Poland and Italy.
Poland satisfied with concessions
Poland, the most vocal critic of the proposed treaty before the talks, received assurances that a procedure allowing outvoted states to stall EU laws would be enshrined in the treaty.
"Poland got what it wanted. The EU reform treaty project is now crowned with success," Polish President Lech Kaczynski said. "I'm very happy this business is behind us."
Britain also had many reservations about the treaty, but obtained "red line" opt-outs in key areas at the last EU summit in June which remained in the draft presented on Thursday.
"The UK's red lines are secured," said British Prime Minister Gordon Brown, attending his first summit since succeeding Tony Blair. "The British national interest has been protected," he added.
Brown was one of the EU leaders at the two-day informal meeting to say that it was time to put years of discussions on the treaty behind them and turn to the more "concrete" problems facing the bloc.
"I have sent a letter round [to] fellow colleagues saying that it is time for Europe to address detailed issues of global economic change, climate change and security," Brown told journalists.
Italy gets extra parliament seat as a sweetener
Italy, which diplomats described as the hardest bargainer during the meeting, obtained one extra seat in the European Parliament, giving it the same number of lawmakers as Britain.
Under the current system, Italy, France and Britain all have the same number of members in the European Parliament. However, the treaty reduces the overall number of lawmakers by 35, to 750, and parliament last week voted for a new distribution, giving Italy fewer seats than its similarly sized partners.
Close to midnight, diplomats agreed to give Italy one more seat without breaching the 750-member cap by excluding the non-voting president of the parliament from the count.
The EU's two heavyweights, Germany and France, both claimed credit for Thursday's success.
Merkel, Sarkozy both claim credit
While French President Nicolas Sarkozy said he was "extremely satisfied" with the result, German Chancellor Angela Merkel highlighted the role played by her government in launching the final treaty talks in June.
"After all the political discussions, this is a great success," Merkel said. "Nothing has been changed from the mandate we agreed at the end of the German presidency." She added that the treaty would now help the EU function more efficiently as a bloc and as a power in the world.
She also acknowledged that the deal had been hammered out through some very frustrating discussions and hard bargaining, especially with the Poles and Italians.
"I can't hide the fact that the way to this agreement was very difficult," Merkel said.
Other tricky issues were successfully addressed earlier in the meeting.
Bulgaria reached a deal allowing it to spell the single currency in Cyrillic as "evro" rather than "euro."
Austria received assurances that moves to limit the number of foreigners attending its universities would not be pursued in the European Court.
Among the treaty's main innovations are clauses reducing the size of the European Commission and streamlining decisions by changing voting rules and limiting the power of individual member states to veto legislation.
It also creates several new posts. These include a president of the European Council of member states, who will represent all the member states, and a high representative of the European Union for foreign affairs and security policy, who will be in charge of the bloc's foreign policy, thereby simplifying its relationships with the outside world.