NEW YORK (Reuters) - Bank of America has agreed to pay $66.6 million to end a lawsuit accusing it of collecting unlawfully high rates of interest, styled as fees, from customers who let their checking accounts stay overdrawn for several days.

The settlement, disclosed in a San Diego federal court filing on Tuesday, resolves a 2016 lawsuit alleging that the so-called extended overdraft fees are really interest and are thus subject to bans on usurious or excessive rates. The deal requires court approval.

The settlement will compensate nearly 6 million Bank of America customers nationwide who paid an extended overdraft fee since February 2014. The bank also agreed to stop charging for extended overdrafts for five years, a shift that will save customers about $1.2 billion, lawyers for the customers said in Tuesday’s court filing.

Bank of America spokesman Jerome Dubrowski declined to comment.

“Our litigation argues that ‘extended’ or ‘continuous’ overdraft fees like the ones Bank of America charged are actually abusive and extremely high interest charges,” Jeffrey Kaliel, an attorney for the customers, said in an email. “Bank of America account-holders will no longer have to endure these charges.”

Bank of America charges a $35 fee when an account is first overdrawn and another $35 if the account remains overdrawn for five days, the customers’ lawsuit said. The bank charges the first fee for honoring a check when a customer has insufficient funds, but it provides no service for the second charge, which is really interest for continued use of the bank’s money, the lawsuit said.

One of the bank’s customers, California resident Joanne Farrell, was charged $35 for being overdrawn for five days, when her negative balance ranged from $3.59 to $284.86, according to the lawsuit.

On an annual basis, that would translate to an interest rate of 897 percent to 71,170 percent, the lawsuit said.

The customers accused the bank of violating the National Bank Act, which generally restricts interest rates for banks to the legal limit where the bank is based, or 8 percent in Bank of America’s home state of North Carolina.

Lawyers for the bank had argued that federal regulations and courts for decades have viewed overdraft fees as different from interest, and extended overdraft fees should be treated the same. The fees are not charged for extending credit but to discourage continued overdraft activity, the bank said.

The case is Farrell et al v Bank of America, U.S. District Court, Southern District of California, No 16-492