DUBLIN (Reuters) - Ireland will make a profit on its shareholdings in Irish banks that are still trading, including fully recovering the 21 billion euros (17 billion pounds) injected into Allied Irish Bank (>> Allied Irish Banks PLC), Finance Minister Michael Noonan said on Friday.

Ireland pumped 64 billion euros - equivalent to 40 percent of annual economic output - into its banks after the sector crashed along with the economy in 2008. Around half of that capital was swallowed up by Anglo Irish Bank (AIB) which is now in liquidation.

Ireland has recouped some of its capital in Bank of Ireland (>> Bank of Ireland), plans to sell shares in Allied Irish and permanent tsb (>> Permanent tsb Group Holdings PLC) next year and should also generate a surplus from the liquidation of Anglo Irish, and via the state's "bad bank", the National Asset Management Agency (NAMA).

"On the banks, we'll be more than quids in. NAMA's already running a surplus and it will run a significant surplus by the time it finishes. The liquidation is running a surplus too," Noonan said in an interview with the Newstalk radio station.

"We'll lose overall on Anglo Irish Bank, but I expect to get all the money back (from the others) ... I had someone in with me Wednesday morning from the United States, he was prepared to sign a cheque for the whole of AIB. There's no problem in flogging off assets in Ireland."

He said the government would get its money back from Allied Irish over a period of years and that he had no intention of selling a residual 14 percent holding in Bank of Ireland, saying he wanted to be able to influence policy in the banks.

Noonan also confirmed on Friday that Ireland will repay 9 billion euros of its International Monetary Fund loans by year-end, and aim to repay a further 9 billion in the first half of 2015 in a bid to reduce the cost of carrying its national debt.

Ireland won agreement from the European Union to pay the IMF before it repays aid from the EU bailout funds, replacing the more expensive loans with cheaper market funding to save around 1.5 billion euros over the next five years.

Ireland raised 3.75 billion euros in 15-year debt earlier this month at a record-low yield of 2.49 percent, compared to the near 5 percent on the shorter-dated IMF funding.

(Reporting by Padraic Halpin; Editing by Kevin Liffey and Susan Fenton)