The Northern Bank and the National Irish Bank have been sold to Denmark's biggest bank, Danske.
The Northern Bank has been sold
The Northern Bank has 95 branches and 30% of the market in Northern Ireland.
The £967m sale is expected to be completed early next year.
Danske said it believed costs at the two banks could be reduced by about 15%.
The sale has been welcomed by the bank officials union the IBOA which said it would be a relief to staff following months of uncertainty.
National Irish has 59 branches and 3% of the market in the Republic of Ireland.
National Australia Bank Chief executive John Stewart said: "This is an excellent outcome for the National.
"We have achieved an attractive price for these banks, generating a significant profit and strengthening our capital base.
"It also opens an exciting new chapter for the two Irish banks and for Danske."
'Sense of welcome relief'
Danske Bank Chief Executive Peter Straarup said he planned to expand NIB's branch network in the Republic.
"The economy of the Republic of Ireland continues to outperform other European economies, and NIB has considerable growth opportunities," he said.
Mr Straarup is expected to become chairman of the banks.
Danske Bank said it would be investing substantially over the next 15 months on new technology in the two banks.
IBOA General Secretary Larry Broderick said staff in both banks had gone through a traumatic few months of insecurity.
"The coming months will be a difficult time for staff in National Irish and Northern Banks and we will be briefing our members in the coming days on the implications of the sale and the impact it will have on their future careers," he said.