Wells Fargo has reached a settlement with the U.S. Justice Department and the SEC over the bogus account scandal that has besieged the bank’s brand.

The company will pay $3 billion as part of the deal to resolve criminal and civil investigations into sales practices that first came to light in 2016.

During a 14-year period stretching back to 2002, unrealistic sales goals set by the bank pushed employees to open millions of client accounts and provide customers products “under false pretenses or without consent,” the DOJ says in a press release. As part of the settlement, Wells Fargo admitted to collecting millions of dollars in ill-gotten fees and interest, unlawfully using customers’ personal data and hurting some of its clients’ credit ratings, according to the DOJ.

“Today’s announcement should serve as a stark reminder that no institution is too big, too powerful, or too well-known to be held accountable and face enforcement action for its wrongdoings,” said Andrew Murray, U.S. Attorney for the Western District of North Carolina, during a press conference following the announcement.

Aggressive cross-selling and unrealistic goals sat at the root of the retail bank’s wrongdoing and set a tone that “permeated all aspects of the consumer banking business," said Nicola Hanna, U.S. Attorney for the Central District of California in Los Angeles, who led the DOJ investigation.

The result was widespread fraud and that led to the the investigation of 23,000 employees, the regulators said during the press conference.

Wells Fargo’s strategy was "loading up each customer with as many products as possible,” Hanna said.

The SEC will distribute $500 million of the $3 billion total settlement to Wells Fargo stockholders, who the SEC said were "misled" by the bank's fraudulent financials. It’s unclear how the money will be apportioned.

“Wells Fargo repeatedly misled investors, including through a misleading [cross-selling] performance metric, about what it claimed to be the cornerstone of its Community Bank business model and its ability to grow revenue and earnings,” Stephanie Avakian, co-director of the SEC’s Division of Enforcement, says in a statement. The cross-sell metric “was inflated by accounts and services that were unused, unneeded, or unauthorized,” the SEC says.

As part of the settlement, Wells Fargo has signed a deferred prosecution agreement under which it will not be prosecuted during three years, provided it meets certain conditions, such a continuing to cooperate with further investigations, according to the DOJ’s press release.