Updated

California and federal regulators fined Wells Fargo a combined $185 million on Thursday, alleging the bank's employees illegally opened millions of unauthorized accounts for their customers in order to meet aggressive sales goals.

The San Francisco-based bank will pay $100 million to the Consumer Financial Protection Bureau, a federal agency created five years ago; $35 million to the Office of the Comptroller of the Currency and $50 million to the City and County of Los Angeles. It will also pay restitution to affected customers.

It is the largest fine the CFPB has levied against a financial institution and the largest fine in the history of the Los Angeles City Attorney's office.

The CFPB said Wells Fargo sales staff opened more than 2 million bank and credit card accounts that may have not been authorized by customers. Money in customers' accounts was transferred to these new accounts without authorization. Debit cards were issued and activated, as well as PINs created, without telling customers.

In some cases, Wells Fargo employees even created fake email addresses to sign up customers for online banking services.

"Wells Fargo built an incentive-compensation program that made it possible for its employees to pursue underhanded sales practices, and it appears that the bank did not monitor the program carefully," said CFPB Director Richard Cordray.

The behavior was widespread, the CFPB and other regulators said, involving thousands of Wells Fargoemployees.

Los Angeles City Attorney Mike Feuer called Wells Fargo's behavior "outrageous" and a "major breach of trust."

"Consumers must be able to trust their banks," Feuer said.

Wells Fargo's aggressive sales tactics were first disclosed by The Los Angeles Times in an investigation in 2013 . The story series prompted the Los Angeles City Attorney office to sue Wells Fargo over its tactics.

Roughly 5,300 employees at Wells Fargo were fired in connection with this behavior, according to Los Angeles City Attorney's office.

In a statement, Wells Fargo said: "We regret and take responsibility for any instances where customers may have received a product that they did not request." Wells Fargo said they've refunded $2.6 million in fees associated with products that were opened without authorization.

Despite the L.A. Times investigation, Wells Fargo is still known for having aggressive sales goals for its employees. Wells Fargo's executives highlight every quarter the bank's so-called "cross sale ratio," which is the number of products the bank sells to each of their individual customers. The ratio hovers around six, which means every customer of Wells Fargo has on average six different types of products with the bank.