Wells Fargo has agreed to pay $3 billion to settle claims related to its creation of millions of fake accounts to meet sales goals, including $500 million that will be returned to investors, the Securities and Exchange Commission said Friday.

The agreement, with the SEC and Justice Department, says the banking giant misled investors about its strategy of selling additional financial products to existing customers, according to the SEC. That “cross-sell” strategy was “inflated by accounts and services that were unused, unneeded, or unauthorized,” the SEC said.

From 2002 to 2016, Wells Fargo opened millions of financial accounts that were unauthorized or fraudulent. Wells Fargo also pressured customers to buy products they didn’t need, the SEC said.

“Wells Fargo repeatedly misled investors, including through a misleading performance metric, about what it claimed to be the cornerstone of its Community Bank business model and its ability to grow revenue and earnings,” said Stephanie Avakian, co-director of the SEC's division of enforcement.

The company agreed to not commit the violations in the future and pay a $500 million civil penalty, which the SEC will distribute to investors.

“The conduct at the core of today's settlements – and the past culture that gave rise to it – are reprehensible and wholly inconsistent with the values on which Wells Fargo is built,” company CEO Charlie Scharf said in a statement. “Our customers, shareholders and employees deserved more from the leadership of this company.”

Wells Fargo also said it has eliminated all product-based sales goals, restructured its compensation based on customer outcomes and strengthened customer consent and oversight systems.

Friday’s settlement ends a large portion of Wells Fargo’s legal problems related to its sales practices. The nation’s fourth-largest bank reshuffled its executive ranks in recent years after the scandal claimed two of its chief executives.

The bank’s settlement, which will weigh on earnings growth in the near term, shows signs that its management team is on the path to reconciling with regulators over its fraudulent sales practices, analysts say.

“For investors, the settlement just means that Wells Fargo will earn less money over a short period of time,” says Marty Mosby, director of bank and equity strategies at Vining Sparks. “The key thing is whether this will allow them to finally come out from under the shadow of regulatory scrutiny. The management change and the settlement are a big step in the right direction.”

But Kilian Colin, a former Wells Fargo employee and whistleblower in the case, was wary.

“Today’s settlement might bring some relief to consumers and workers, but it does not relinquish Wells Fargo’s duty to change the workplace culture that fueled the disastrous scandal in the first place," said Colin, now a member of Committee for Better Banks, which represents frontline employees of banks and credit unions across the country. "Four years later, workers are not confident that they are seeing the necessary changes to repair the harm done."

The House Financial Services Committee has conducted its own investigation of the banking giant and plans to announce the results during hearings in March. Rep. Maxine Waters, D-California, the frequent Wells Fargo critic who chairs the panel, voiced disappointment with the settlement terms.

"This fine barely dents Wells Fargo’s $200 billion in profit over the last ten years," Walters said in a written statement. "In short, this fine which is coupled with a deferred prosecution agreement, is the cost of doing business for a bank with $1.9 trillion in assets. Wells Fargo must be fully accountable to the public for its crimes."

Contributing: Kevin McCoy