Wells Fargo said Friday that it faces a potential $1 billion in fines to resolve government investigations into the megabank’s behavior in the auto and mortgage markets.

The bank has acknowledged that it charged thousands of customers for auto insurance they didn’t need, driving some to default on their loans and lose their cars through repossession. The bank has also said it will refund customers who were charged improper fees to lock in an interest rate for a Wells Fargo mortgage.

Both matters have been under investigation for months by two federal regulators, the Consumer Financial Protection Bureau and the Office of the Comptroller of the Currency. Those regulators are offering to resolve the matter for a combined $1 billion, the bank said. Such a large civil penalty would just be the latest hit to Wells Fargo’s effort to rebuild its image after more than a year of scandal.

“I’m confident that our outstanding team will continue to transform Wells Fargo into a better, stronger company,” Tim Sloan, the bank’s chief executive, said in a statement.

San Francisco-based Wells Fargo has been struggling to rebuild its reputation since acknowledging in 2016 that it had opened millions of sham accounts customers didn’t want.

Despite grappling with a potentially massive fine, Wells Fargo on Friday reported a surge in its business during the first quarter. Profits jumped to $5.9 billion during the first three months of this year, compared with $5.6 billion in the same period last year. Revenue fell slightly to $21.9 billion, compared with $22.3 billion last year.

Wells and several other big banks reported that the new, lower corporate tax rate and rising interest rates were helping boost their bottom lines.