NEW YORK — Citigroup Inc. will pay nearly $18 million in refunds and settlement charges for taking $14 million from customers' credit-card accounts, California's attorney general said Tuesday.

Citigroup will make refunds to the 53,000 customers affected, and pay $3.5 million in damages and civil penalties to the state of California, which had been investigating the questionable practices for three years, the attorney general said.

The bank will also pay 10 percent interest to California customers, who accounted for $1.6 million of the money "swept" out of accounts and into a Citi fund between 1992 and 2003.

Citigroup's "account sweeping program" automatically removed positive balances from customers' credit-card accounts, Attorney General Edmund G. Brown Jr. said. For instance, if a customer double-paid a bill by mistake or refunded a purchase for credit, that positive balance was then taken from the customer without notification, Brown said.

"The company knowingly stole from its customers, mostly poor people and the recently deceased, when it designed and implemented the sweeps," said Brown in a statement. "When a whistleblower uncovered the scam and brought it to his superiors, they buried the information and continued the illegal practice."

Citigroup, however, said in a statement that it voluntarily stopped the computerized "sweeping" practice in 2003, and that it also voluntarily began refunding customers before the settlement.

"We take issue with the state's characterization of our conduct and the parties' voluntary settlement," Citigroup said in a statement. "This agreement affirms our actions, and we are continuing to make full refunds to all affected customers."