AIB says it has identified an error in relation to the classification of some customers' accounts, which resulted in incorrect charges being applied.
The bank says that some personal accounts may have been classified as business and some business accounts as personal.
This error could have resulted in incorrect fees and charges and/or interest being applied to customer accounts, it says.
It added that the incorrect classification may have arisen over a number of years, affecting an estimated 40,000 accounts.
It says the total refund would be €4m, plus compensatory interest. This means that average refund is expected to be about €100.
In a statement, AIB said that it informed the Financial Regulator of the incorrect charges when the issue was identified in November 2008.
It said that at the request of the regulator, independent assurance is being provided by KPMG and a process is under way to identify the accounts which might be affected.
AIB has begun writing to potentially impacted customers and says it will contact all affected customers before the end of the year to make them aware of the issue, apologise and inform them of the steps the bank is taking to fix the matter.
AIB says it will not be recouping any fees and interest which have been underpaid.