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.

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

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.

A Wells Fargo branch is seen in the Chicago suburb of Evanston, Illinois. REUTERS/Jim Young

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 were 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 Fargo employees.

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.

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 any product that was opened without authorization.

Despite the LA 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 sales 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.