DUBLIN (Reuters) - Ireland has appointed Goldman Sachs (>> Goldman Sachs Group Inc) to advise on the sale of AIB (>> Allied Irish Banks PLC), finance minister Michael Noonan wrote on Monday, as the state looks to recover all 21 billion euros (16 billion pounds) spent on rescuing the country's second-largest bank by assets.

The appointment of an advisor marks a stepping stone in Ireland's bid to get private investment into AIB after its 2010 nationalisation, but no transaction is likely until the second half of 2015.

The Department of Finance said in a statement that Goldman Sachs was selected after a "mini tender" in December during which banks on a pre-approved panel were invited to bid for the business.

A source familiar with the situation said Goldman Sachs' pitch included doing the work free of charge. A London-based Goldman Sachs spokesman could not immediately comment.

Ireland increased its valuation of its AIB investment to 13.3 billion euros at the end of last year, including 1.6 billion euros of contingent capital instruments, up from 11.6 billion euros a year earlier. It will need to sell the bank at a significantly higher value for the state to get break even on its 21 billion euros investment.

"Much of the banking-related work in the Department of Finance this year will focus on AIB," Noonan wrote. "Officials within my department are working with AIB on reconfiguring the capital structure. Goldman Sachs International has been appointed to provide financial advice."

Ireland hopes to sell at least some of its stake in AIB and permanent tsb this year. Permanent tsb must also raise money because it failed the European Central Bank's landmark stress tests in October.

Noonan said Ireland had already clawed back 5 billion euros of its bank bailout money through the sales of a contingent convertible bond at Bank of Ireland and the life insurance arm of permanent tsb. The state has made another 5.9 billion euros in interest and fees from the rescued banks.

Ireland's banks were among dozens across the EU that had to be rescued by their states in the aftermath of the 2007 global financial crisis. Some tentative sell-offs have begun, such as the 2013 sale of 3.2 billion pounds of shares in the UK's Lloyds Banking Group (>> Lloyds Banking Group PLC), but states retain most of their original investments, including the UK's Royal Bank of Scotland (>> Royal Bank of Scotland Group plc), Portugal's Banco Espirito Santo (>> BANCO ESPIRITO SANTO) and three of Greece's largest lenders.

($1 = 0.8434 euros)

(Reporting By Laura Noonan; Editing by David Goodman and Louise Heavens)

By Laura Noonan