Wells Fargo agreed to pay $1 billion to settle allegations from multiple regulators it engaged in lending abuses in its auto insurance and home loan businesses.

The settlement, announced Friday with the Consumer Financial Protection Bureau and the Office of the Comptroller of the Currency, has been widely anticipated. Last week, Wells reported a profit of $5.9 billion for the first quarter but said that number could change if it has to restate earnings once the settlement is reached.

Wells said Friday the settlement would cut $800 million off its first-quarter profit, taking it to $4.7 billion, or 96 cents a share. Shares of Wells closed Friday up 1.9 percent.

The CFPB said Friday the violations were connected to how Wells Fargo administered a mandatory insurance program in its auto loan business and how it charged certain borrowers for mortgage interest rate lock products.

Wells agreed to pay back the customers and make changes to its risk and compliance practices.

"While we have more work to do, these orders affirm that we share the same priorities with our regulators and that we are committed to working with them as we deliver our commitments with focus, accountability, and transparency," Wells CEO Tim Sloan said in a statement.

Acting CFPB head Mick Mulvaney said in a statement: "I am especially pleased that we were able to work closely and effectively with our colleagues at the OCC, and I appreciate the key role they played in the negotiations. As to the terms of the settlement: we have said all along that we will enforce the law. That is what we did here."

Under the settlement, Wells Fargo is required to give its board plans detailing its efforts to strengthen its compliance and risk-management functions and how it will repay customers.

The San Francisco bank, the nation's third-largest, has been struggling to come back from a fake accounts scandal that surfaced in 2016. Branch employees, under pressure to meet aggressive sales targets, had opened millions of fake accounts in customers' names without their knowledge.

Wells Fargo retooled its top executive ranks after that, but subsequent investigations into its own sales practices unearthed issues in its auto lending, mortgage and wealth management divisions.

The Federal Reserve took the unusual step earlier this year to restrict Wells Fargo's loan growth until it makes several internal changes to its risk management.