Mexico’s fearsome Sinaloa Cartel was so practiced at laundering millions of dollars in drug profits at the Mexican branches of the global bank HSBC that it packed bulk cash in boxes that were measured to slide neatly under the teller windows.

The Justice Department’s record $1.9 billion settlement Tuesday with HSBC exposed the continuing ability of drug cartels, rogue nations and terrorist financiers to move billions of dollars through the international and U.S. banking systems.

Money laundering was a major focus of U.S. counterterrorism policy after the Sept. 11, 2001, attacks. The Patriot Act of 2002 included provisions that required the Treasury Department to identify banks and individuals suspected of links to terrorism. And the law instructed banks to strictly monitor and report potentially illegal transactions.

But a string of august names in global banking — Credit Suisse, Lloyds Bank, ABN Amro, ING Bank and now HSBC — have reached settlements in the past couple of years with the U.S. government for billions of dollars in tainted transactions. These investigations have revealed that weaknesses in the financial system lay not with the so-called hawala brokers of Karachi, Pakistan, but the bespoke bankers of London, Amsterdam and Geneva, and their American affiliates.

“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,” Assistant Attorney General Lanny A. Breuer said at a news conference in New York on Tuesday.

One of the world’s largest banks, HSBC has its headquarters in London and $2.5 trillion in assets. It earned nearly $22 billion in profits in 2011.

Breuer said that between 2006 and 2010, the Sinaloa Cartel in Mexico, the Norte del Valle Cartel in Colombia and other drug traffickers laundered at least $881 million in illegal narcotics trafficking proceeds through HSBC.

“These traffickers didn’t have to try very hard,” Breuer said. “They would sometimes deposit hundreds of thousands of dollars in cash, in a single day, into a single account, using boxes designed to fit the precise dimensions of the teller windows.”

The illicit money was submerged in the billions of dollars of transfers that flowed between HSBC’s Mexican and American affiliates. In many cases, the illicit cash was generated by drug sales in American cities, smuggled to Mexico and deposited at HSBC there. Then it was wired back to an account at HSBC in the United States as clean money. In other cases, bulk cash was deposited and converted into local currency, a process called the Black Market Peso Exchange by investigators.

Stuart Gulliver, HSBC’s group chief executive, said the bank “is a fundamentally different organization from the one that made those mistakes.”

“We accept responsibility for our past mistakes. We have said we are profoundly sorry for them, and we do so again,” Gulliver said in a statement. “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.”

The settlement drew criticism that HSBC had escaped lightly, given the gravity and scale of the crimes.

“If these people aren’t prosecuted, who will be?” asked Jack Blum, a Washington attorney and a former special counsel for the Senate Foreign Relations Committee who specializes in money laundering and financial crimes. “What do you have to do to be prosecuted? They have crossed every bright line in bank compliance. When is there an offense that’s bad enough for a big bank to be prosecuted?”

The Justice Department reserved the right to prosecute HSBC anytime in the next five years if it fails to comply with the terms of the agreement announced Tuesday. Under the deferred prosecution agreement, the bank must adopt far stricter internal controls with independent monitoring.

In deciding not to prosecute now, Breuer said the Justice Department considered “the collateral consequences,” including the possible effects on the worldwide financial system if HSBC’s ability to operate was ruined by criminal conviction.

“If you prosecute one of the largest banks in the world, do you risk that people will lose jobs, other financial institutions and other parties will leave the bank, and there will be some kind of event in the world economy?” Breuer said in an interview. “This is a very targeted, very real resolution. It’s fiction to say it’s a slap on the wrist.”

John Morton, director of U.S. Immigration and Customs Enforcement, which was part of a Homeland Security task force that investigated HSBC in Mexico, said officials will “continue to aggressively target financial institutions whose inactions are contributing in no small way to the devastation wrought by the international drug trade.”

HSBC was also accused of allowing Iran, Sudan, Cuba and other countries subject to U.S. sanctions to move hundreds of millions of dollars through the U.S. financial system in violation of U.S. law.

“On at least one occasion, HSBC instructed a bank in Iran on how to format payment messages so that the transactions would not be blocked or rejected by the United States,” Breuer said. Payment instructions sometimes included a notation saying “do not mention Iran,” U.S. officials said.

HSBC affiliates in Europe and the Middle East also “systematically altered transaction information to strip out any reference to Iran and characterized the transfers as between banks in approved jurisdictions,” according to a July report by the Senate permanent subcommittee on investigations.

The subcommittee report said an outside auditor hired by HSBC’s U.S. affiliate found 25,000 undisclosed transactions involving Iran. And the report said that HSBC conducted business with Saudi and Bangladeshi banks suspected of having links to terrorism.

Danielle Douglas contributed to this report.