European leaders agreed a new package of anti-crisis measures at a two-day summit, but were forced to delay increasing their rescue fund and acknowledged they faced new threats from a government collapse in Portugal.

Battling to stem a debt crisis that has raged for over a year and pushed both Greece and Ireland to accept bailouts, the EU had promised to unveil a comprehensive solution at the March 24-25 summit that it hoped would reassure jittery markets.

But the abrupt resignation of Portuguese Prime Minister Jose Socrates on the eve of the meeting, after his austerity measures were rejected by parliament, cast a long shadow. Uncertainty in other euro members such as Finland and Ireland also prevented leaders finalizing fundamental elements of their plan.

The euro has survived a critical test but there is lots of homework to be done, German Chancellor Angela Merkel told reporters, saying the bloc needed to atone for past sins.

This is a comprehensive package which I think is a big step forward. Whether it will be sufficient, only time will tell.

Yields on Portugal's 10-year benchmark bonds pushed above 8 percent to a new record on Friday, a rate seen as unsustainable for a country which needs to refinance about 4.5 billion euros of debt in April and a similar amount in June.

Leaders were able to seal a deal on funding for the European Stability Mechanism (ESM) a new, permanent safety net that will become operational from mid-2013.

Merkel backtracked before the summit on a deal that would have forced Germany, Europe's biggest economy and paymaster, to put up 11 billion euros for the fund in its first year, reducing her wiggle room for tax cuts before the next election.

Under the compromise, capital injections totaling 80 billion euros for all euro zone members will be spread out over five years rather than three, with smaller installments.

Euro zone leaders also formally backed the Euro Plus Pact, a list of areas for expanded economic policy harmonization which has been renamed three times because of sensitivities in various individual member states.

Six EU states that do not use the single currency -- Bulgaria, Denmark, Latvia, Lithuania, Poland and Romania -- joined the 17 euro states in backing the pact, in part out of worries they could be excluded from future policy talks.

Britain, Sweden, Czech Republic and Hungary remain out.

NEXT DOMINO

In other areas the summit fell short of expectations.

Although leaders had agreed in principle earlier this month to boost the lending capacity of their temporary safety net -- the European Financial Stability Facility (EFSF) -- to 440 billion euros from roughly 250 billion, they had to push this back until mid-year because of looming elections in Finland.

A deal on debt relief for Ireland has also been delayed pending the results of bank stress tests due next week which could show a sharp deterioration in the balance sheets of the country's stricken financial institutions.

Concerns are growing that Irish banks could require more capital than the 35 billion euros set aside for them under last year's EU/IMF bailout.

Portugal is widely expected to be the next euro zone domino to fall after Ireland and Greece.

Socrates, the second euro zone leader to fall victim to the bloc's sovereign debt crisis after ousted Irish prime minister Brian Cowen, attended the summit despite having submitted his resignation late on Wednesday.

He made clear his continued opposition to asking for a bailout, and said that whatever Portuguese government next comes to power, it would stand by its fiscal commitments.

Portugal's president was consulting with political leaders in Lisbon on Friday to decide whether to call snap elections. If he does, by law they cannot be held before nearly two months have expired.

Any decision on whether to seek a bailout may therefore only be taken in May, meaning more weeks of limbo for markets.

CONTAGION FEARS

Whether a new political mandate will be enough to implement the inevitable austerity measures is doubtful, although the opposition has committed itself to the general deficit targets, Unicredit economists said in a note on Friday.

What is more likely, in contrast, is that the EMU-wide political and public conflict over the costs of the debt crisis and the design of an anti-crisis mechanism will increase.

Reflecting the uncertainty, both Standard & Poor's and Fitch cut Portugal's credit rating by two notches.

Should Lisbon opt for a rescue, senior euro zone officials have said it will likely need 60-80 billion euros in assistance from the EU rescue fund and the International Monetary Fund.

With Portugal close to the brink, attention could shift to Spain, which has gradually won back the confidence of investors by unveiling reforms of the labor market and pension system, as well as a plan for shoring up its ailing savings banks.

While the spreads of Portuguese 10-year bond yields over benchmark German bonds have climbed to new highs, those of Spanish bonds have fallen to their lowest level in nearly two months.

Spanish Prime Minister Jose Luis Rodriguez Zapatero said on Friday he did not fear contagion from Portugal despite the close economic ties between the neighbors. Spanish banks hold roughly a third of Portuguese debt.

But he pledged to take additional measures to strengthen state finances, nonetheless.

In my opinion we are in a position to withstand the political situation in Portugal, Zapatero said.

(Reporting by Marc Angrand, Rex Merrifield, Luke Baker, Christopher Le Coq, Eva Dou, Julien Toyer, Paul Taylor, John O'Donnell, Justyna Pawlak)

(Writing by Noah Barkin, editing by Mike Peacock)