Wells Fargo agreed Friday to pay $3 billion to settle potential federal criminal and civil charges that, for more than a decade, the bank’s aggressive sales goals led to widespread consumer abuses, including millions of accounts opened without customers’ consent.

Under its settlement with the Justice Department and the Securities and Exchange Commission, Wells Fargo acknowledged that it had collected millions of dollars in fees as employees falsified records, forged signatures and misused customers’ personal information to open fake accounts in order to meet unrealistic sales goals. Bank leaders knew of the misbehavior, including “violations of federal criminal law,” as early as 2002 but didn’t stop it until 2016, according to the settlement agreement.

The $3 billion fine, which is about 15 percent of Wells Fargo’s $19.5 billion in profits last year, is among the largest corporate penalties handed down during the Trump administration but not a record.

Friday’s settlement, which includes a deferred prosecution agreement, does not cover any individual employees. No senior bank employees have been criminally charged.

“This case illustrates a complete failure of leadership at multiple levels” within Wells Fargo, said Nick Hanna, U.S. attorney for the Central District of California, in a statement. “Simply put, Wells Fargo traded its hard-earned reputation for short-term profits, and harmed untold numbers of customers along the way.”

Charlie Scharf, the bank’s chief executive, said in a statement, “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 was built. While today’s announcement is a significant step in bringing this chapter to a close, there’s still more work we must do to rebuild the trust we lost.”

The settlement comes as Wells Fargo, one of the country’s largest and most profitable banks, struggles to repair its image. Its progress has been slowed by its admission of other consumer abuses over the past few years, including mistakenly foreclosing on hundreds of clients and repossessing the cars of thousands of others. Friday’s settlement does not cover that conduct.

The bank still faces significant regulatory hurdles. The Federal Reserve has banned Wells Fargo, which has nearly $2 trillion in assets, from growing any bigger until it fixes its systemic cultural issues, and the Office of the Comptroller of the Currency (OCC) has indicated it is unhappy with the bank’s progress in addressing its problems.

Last month, the OCC went further, taking the rare step of filing cases against specific Wells Fargo employees. It banned former chief executive John Stumpf from working in banking again and fined him $17.5 million, and filed civil cases against five other employees, including Carrie Tolstedt, the former head of community banking. It is seeking a $25 million fine from Tolstedt.

The bank imposed unrealistic sales goals on employees, who were “intimidated and badgered” to comply, the OCC lawsuit says. In 2010, one employee told senior executives, “The noose around our necks ha[s] tightened: we have been told we must achieve the required solutions goals or [we] will be terminated.” Another employee wrote to the chief executive’s office and another senior leader in 2013, saying, “I was in the 1991 Gulf War. … This is sad and hard for me to say, but I had less stress in the 1991 Gulf War than working for Wells Fargo.”

Between 2011 and 2015, “tens of thousands of employees were the subject of allegations of unethical sales practices,” and more than 5,300 were fired, according to a statement of facts agreed to by Wells Fargo.

About $500 million of the $3 billion settlement will go to the SEC, which alleged that the bank misled investors about its “cross-selling” business strategy. “This settlement holds Wells Fargo responsible for its fraud,” Stephanie Avakian, co-director of the SEC’s enforcement division, said in a statement.

Wells Fargo has repeatedly apologized for the sales scandals, overhauled its board and gone through three chief executives in three years, hiring an industry veteran, Scharf, to take the helm last year.

Scharf told analysts last month that he is spending nearly all of his time addressing the regulatory headaches that have dogged Wells Fargo. “We are committing all necessary resources to ensure that nothing like this happens again, while also driving Wells Fargo forward,” he said Friday.

The scandals have made Wells Fargo a frequent target of Democrats on Capitol Hill, particularly Rep. Maxine Waters (Calif.), chair of the powerful Financial Services Committee, and Sen. Elizabeth Warren (Mass.). “Bank executives like former @WellsFargo CEO John Stumpf should face jail time when the banks they lead break the law. I’ve got a bill to hold Wall Street executives personally accountable,” Warren said in a recent tweet.

Waters has scheduled three hearings next month on “holding Wells Fargo accountable.”