NEW YORK — 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.

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. In some cases, Wells Fargo employees 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.

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

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'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.

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