ANZ says it has refunded nearly 400,000 customers almost $29 million after catching itself charging dodgy fees.

The bank dobbed itself in to the Australian Securities and Investments Commission (ASIC) when it realised it had been charging fees on transactions outside its own definition of a periodical payment.

ANZ defines a periodical payment as one made to “another person or business”, but the periodical payment fees were charged on transactions made between customers’ own accounts.

The fees mostly consisted of non-payment fees for insufficient funds and payment fees on commercial accounts.

The bank says it is giving back $25.8 million dollars in fee refunds and $3 million in interest.

ANZ said 376,570 retail accounts and 17,230 business accounts were affected.

“We proactively reported this matter to ASIC and have been working hard to ensure customers are repaid as soon as possible,” ANZ group Australia executive Fred Ohlsson said in a statement.

“We've already begun making payments to our customers and expect all customers will be refunded by the end of September.”

The bank has given back $11 million to 192,000 accounts so far, and has changed its terms and conditions to clarify when periodical payment fees will be charged.