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. "However, we recognize that it will take time to put all of our challenges behind us."

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. Its longtime chief executive resigned, and Wells paid millions of dollars in fines and overhauled its board of directors. Last month, the Federal Reserve levied an unprecedented penalty against the bank, blocking its ability to expand.

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.

JPMorgan Chase, for example, reported that its revenue hit record highs during the first quarter. The bank's revenue rose about 10 percent to $28 billion. Profit reached $8.7 billion, up 35 percent from $6.5 billion during the same period last year. This came as JPMorgan's effective income tax rate fell to 18.3 percent in the first quarter, compared with 22.7 percent last year.

The year "is off to a good start with our businesses performing well across the board," Jamie Dimon, the bank's chief executive, said in a statement. "The global economy continues to do well, and we remain optimistic about the positive impact of tax reform in the U.S."

The recent volatility in the stock market, which has fallen, then risen hundreds of points on some days, has also helped boost banks' profits.

Citigroup reported that quarterly profit jumped 13 percent to $4.6 billion, the highest it's been in three years, while revenue was up 2.8 percent to $18.9 billion. This came as the bank's revenue from its stock trading business rose 38 percent to $1.1 billion.

"While market conditions have been uneven so far this year, our first-quarter results show our ability to deliver for both clients and shareholders and we look forward to sustaining this momentum for the balance of the year," Citigroup chief executive Michael Corbat said in a statement.

Despite the strong results, JPMorgan and Citi's stock prices fell about 3 percent in early trading Friday. Wells Fargo was down about 3.5 percent.