Everyone hates paying bank fees. But imagine paying fees on a ghost account you didn't even sign up for.

That's exactly what happened to Wells Fargo customers nationwide.

On Thursday, federal regulators said Wells Fargo (WFC) employees secretly created millions of unauthorized bank and credit card accounts -- without their customers knowing it -- since 2011.

The phony accounts earned the bank unwarranted fees and allowed Wells Fargo employees to boost their sales figures and make more money.

"Wells Fargo employees secretly opened unauthorized accounts to hit sales targets and receive bonuses," Richard Cordray, director of the Consumer Financial Protection Bureau, said in a statement.

Wells Fargo confirmed to CNNMoney that it had fired 5,300 employees over the last few years related to the shady behavior. Employees went so far as to create phony PIN numbers and fake email addresses to enroll customers in online banking services, the CFPB said.

Related: Who owns Wells Fargo? You, me and Warren Buffett

The scope of the scandal is shocking. An analysis conducted by a consulting firm hired by Wells Fargo concluded that bank employees opened over 1.5 million deposit accounts that may not have been authorized.

The way it worked was that employees moved funds from customers' existing accounts into newly-created ones without their knowledge or consent, regulators say. The CFPB described this practice as "widespread." Customers were being charged for insufficient funds or overdraft fees -- because there wasn't enough money in their original accounts.

Additionally, Wells Fargo employees also submitted applications for 565,443 credit card accounts without their customers' knowledge or consent. Roughly 14,000 of those accounts incurred over $400,000 in fees, including annual fees, interest charges and overdraft-protection fees.

The CFPB said Wells Fargo will pay "full restitutions to all victims."

Related: ATM and overdraft fees top $6 billion at the big 3 banks

Wells Fargo is being slapped with the largest penalty since the CFPB was founded in 2011. The bank agreed to pay $185 million in fines, along with $5 million to refund customers.

"We regret and take responsibility for any instances where customers may have received a product that they did not request," Wells Fargo said in a statement.

Wells Fargo has the highest market valuation among any bank in America, worth just north of $250 billion. Berkshire Hathaway (BRKA), the investment firm run legendary investor Warren Buffett, is the company's biggest shareholder.

Of the total fines, $100 million will go toward the CFPB's Civil Penalty Fund, $35 million will go to the Office of the Comptroller of the Currency, and another $50 million will be paid to the City and County of Los Angeles.

"One wonders whether (the CFPB) penalty of $100 million is enough," said David Vladeck, a Georgetown University law professor and former director of the Federal Trade Commission's Bureau of Consumer Protection. "It sounds like a big number, but for a bank the size of Wells Fargo, it isn't really."

Wells Fargo confirmed to CNNMoney that the 5,300 firings took place over several years. The bank listed 265,000 employees as of the end of 2015.

Related: Barclays fined $109 million for trying to hide a deal with rich clients

"At Wells Fargo, when we make mistakes, we are open about it, we take responsibility, and we take action," the bank said in a memo to employees on Thursday.

The CFPB declined to comment on when the investigation began and what sparked it, citing agency policy. "We don't comment on how we uncover these matters," a spokesman said.

As part of the settlement, Wells Fargo needs to make changes to its sales practices and internal oversight.

Customers are fuming. Brian Kennedy, a Maryland retiree, told CNNMoney he detected an unauthorized Wells Fargo account had been created in his name about a year ago. He asked Wells Fargo about it and the bank closed it, he said.

"I didn't sign up for any bloody checking account," Kennedy, who is 57 years old, told CNNMoney. "They lost me as a banking customer and I have warned family and friends."

"Consumers must be able to trust their banks," said Mike Feuer, the Los Angeles City Attorney who joined the settlement.

Feuer's office sued Wells Fargo in May 2015 over allegations of unauthorized accounts. After filing the suit, his office received more than 1,000 calls and emails from customers as well as current and former Wells Fargo employees about the allegations.

Wells Fargo declined to say when it hired a consulting firm to investigate the allegations. However, a person familiar with the matter told CNNMoney the bank launched the review after the L.A. lawsuit was filed.

Even though the Wells Fargo scandal took place nationally, the settlement with L.A. requires the bank to specifically alert all its California customers to review their accounts and shut down ones they don't recognize or want.

"How does a bank that is supposed to have robust internal controls permit the creation of over a half-million dummy accounts?" asked Vladeck. "If I were a Wells Fargo customer, and fortunately I am not, I'd think seriously about finding a new bank."

--To reach the author of this article email Matt.Egan@cnn.com