* Deal cuts Ireland's borrowing needs by 20 bln euros over decade
* Longer repayments ease austerity burden by 1 bln euros annually
* Anglo IOUs replaced by Irish bonds with maturities of up to 40 yrs
By Padraic Halpin and Carmel Crimmins
DUBLIN Feb 7 (Reuters) - Ireland clinched a long-awaited deal on Thursday to ease the burden of its bank debts, sending its borrowing costs falling to pre-crisis levels and bolstering its chances of ending its reliance on EU-IMF loans this year.
After nearly 18 months of negotiation, Prime Minister Enda Kenny won European Central Bank (ECB) approval to stretch out the cost of bailing out Anglo Irish Bank, slicing billions off the country's borrowing needs and cutting its budget deficit.
"Today's outcome is an historic step on the road to economic recovery," Kenny told a packed parliament in Dublin. "It secures the future financial position of the state."
The assent of the ECB is a major coup for Kenny, who was forced to call an emergency session of parliament last night to liquidate Anglo Irish, a lender whose casino-style attitude to risk helped precipitate the country's financial implosion.
"It certainly is unusual in the history of the crisis that we are actually being surprised in a positive way by the scale of the response," said Austin Hughes, chief economist at KBC Bank. "Normally we have seen underachievement and overpromising.
"The early indications are that this will make a material difference for the outlook on the Irish economy."
The agreement stretches the cost of bailing out Anglo Irish over 40 years rather than ten and cuts Ireland's borrowing needs by 20 billion euros over the next decade.
It also gives the government another 1 billion euros to work with in forthcoming budgets.
Technical talks between the ECB and Irish officials had been bogged down by ECB concerns that any deal given to Dublin to ease the 48 billion euros cost of the Anglo promissory notes could set a precedent for other countries, such as Spain, which are also dealing with large bank debts.
But with European leaders keen to offer a success story from the region's debt crisis to encourage both voters and potential investors, Dublin went back to the drawing board.
The new deal was designed so that the ECB did not have to vote on it, enabling ECB President Mario Draghi to say simply that the Governing Council had simply "taken note" of Dublin's plan.
The yield on Irish benchmark 2020 bonds fell as low as 3.955 percent, the lowest seen in an equivalent Irish benchmark bond since early 2007, before the subprime crisis started, according to Reuters data.
The government said it had cut its forecast for next year's budget deficit as a proportion of GDP to 4.5 percent from 5.1 percent previously and to 2.4 percent from 2.9 percent previously for 2015, below a target of three percent.
"It is positive for funding, and therefore increases Ireland's chances of leaving its (EU-IMF) loan programme and relying more heavily on the capital markets for funding toward the end of this year," said Fergus McCormick, head of sovereign ratings at DBRS ratings agency.
"However, the swap itself will not affect our A (low) rating or negative trend on Ireland, because swapping the promissory notes for a bond does not reduce the stock of public debt."
Under the terms of the deal, first reported by Reuters on Wednesday, Anglo's promissory notes, with an average maturity of between seven and eight years, will be exchanged for government bonds with an average maturity of over 34 years. The first principal repayment will be made in 2038 and the last in 2053.
The finance spokesman for the opposition Sinn Fein party said the agreement would burden future generations.
"This week my youngest son began to crawl. He wasn't even born at the time the promissory note was issued, yet he'll be 40 years of age and this state will be paying back the toxic debts of Anglo Irish Bank," Pearse Doherty told parliament.
Anglo Irish's near-collapse in 2008 pressured the government into guaranteeing the entire financial sector, sucking it into a downward spiral and in late 2010, a 67.5-billion euro loan from the EU and IMF.
Kenny rushed through emergency laws to liquidate Anglo Irish in the early hours of Thursday morning, the first part of a plan to avoid having to keep paying 3.1 billion euros annually on the Anglo Irish promissory notes.
That annual payment was equivalent to more than 670 euros ($900) for every single person in the country.
Irish people, fed up with years of tax increases and spending cuts, did not expect much of a lift.
"It's a positive thing, definitely, but it won't mean much to the ordinary Irishman," said Turlough O'Brien, a gravedigger from north Dublin.
"There are still more austerity budgets to come and people will be hit with more taxes, like property tax and water charges."
"We're going to have to get used for paying for the government's mistakes. It's still very much austerity and we have to carry the can."