British banking giant HSBC has agreed to pay U.S. authorities almost US$2 billion to settle allegations that it failed to comply with anti-money laundering and sanctions laws, the bank said Tuesday.

The deal, which includes a deferred prosecution agreement with the U.S. Department of Justice, will see the bank pay US$1.921 billion, continue to cooperate with regulatory and law enforcement authorities, and take further action to strengthen its compliance policies and procedures. HSBC says it has also reached agreement to achieve a global resolution with all other US government agencies, and that it anticipates finalizing an undertaking with the UK’s Financial Services Authority (FSA) shortly.

The bank agreed to forfeit US$1.256 billion and enter into a deferred prosecution agreement with the Justice Department over allegations that it illegally conducted transactions on behalf of customers in Cuba, Iran, Libya, Sudan and Burma – all countries that were subject to U.S. sanctions. Separately, the U.S. Department of the Treasury announced settlements amounting to US$875 million, which is the largest collective settlement in the department’s history.

In addition to forfeiting US$1.256 billion as part of its deferred prosecution agreement with the Department of Justice, HSBC has also agreed to pay US$665 million in civil penalties —US$500 million to the Office of the Comptroller of the Currency (OCC) and US$165 million to the Federal Reserve, for its AML program violations. The OCC penalty also satisfies a US$500 million civil penalty of the Financial Crimes Enforcement Network (FinCEN); and, the bank’s US$375 million settlement agreement with OFAC is satisfied by the forfeiture to the Department of Justice.

Justice said that a four-count felony criminal information was filed in federal court in the Eastern District of New York Tuesday, charging HSBC with willfully failing to maintain an effective anti-money laundering program, and willfully failing to conduct due diligence on its foreign correspondent affiliates. It says that the bank has waived federal indictment, agreed to the filing of the information, and has accepted responsibility for its criminal conduct and that of its employees.

“HSBC is being held accountable for stunning failures of oversight – and worse – that led the bank to permit narcotics traffickers and others to launder hundreds of millions of dollars through HSBC subsidiaries, and to facilitate hundreds of millions more in transactions with sanctioned countries,” said assistant attorney general, Lanny Breuer.

“The record of dysfunction that prevailed at HSBC for many years was astonishing. Today, HSBC is paying a heavy price for its conduct, and, under the terms of today’s agreement, if the bank fails to comply with the agreement in any way, we reserve the right to fully prosecute it,” Breuer added.

U.S. attorney, Loretta Lynch, said, “HSBC’s blatant failure to implement proper anti-money laundering controls facilitated the laundering of at least US$881 million in drug proceeds through the U.S. financial system.”

Additionally, the U.S. Fed also issued a consent cease and desist order against HSBC, and the UK’s FSA has imposed a number of requirements on the bank, which are designed to ensure that all parts of the HSBC Group are in compliance with the relevant legal and regulatory requirements to prevent similar failings occurring in the future.

The bank stresses that it has taken a variety of actions over the past few years to fix past shortcomings. It has ramped up spending on anti-money laundering efforts, and increased staffing in that area; revamped its know-your-customer (KYC) program; exited 109 correspondent relationships for risk reasons; clawed back bonuses for a number of senior officers; and, spent over US$290 million on remedial measures. It has also undertaken a comprehensive overhaul of its structure, controls, and procedures, it says.

Over the five-year term of the agreement with the Department of Justice, an independent monitor will evaluate HSBC’s progress in fully implementing reforms, and will produce regular assessments of the effectiveness of its compliance function.

“We accept responsibility for our past mistakes. We have said we are profoundly sorry for them, and we do so again,” said HSBC CEO, Stuart Gulliver. “The HSBC of today is a fundamentally different organisation from the one that made those mistakes. Over the last two years, under new senior leadership, we have been taking concrete steps to put right what went wrong and to participate actively with government authorities in bringing to light and addressing these matters.”

“While we welcome the clarity that these agreements bring, ensuring the highest standards wherever we do business is an ongoing process. We are committed to protecting the integrity of the global financial system. To this end we will continue to work closely with governments and regulators around the world,” he added.