IOWA CITY, Iowa (AP) — U.S. Bank will pay $ 18 million to settle a lawsuit alleging that its lax oversight enabled the founder of one of the nation’s largest brokerages to embezzle $ 215 million from customers, a judge ruled Wednesday.

The payment will go to customers who had accounts to trade domestic commodities futures through the now-collapsed Peregrine Financial Group, Inc., under the settlement approved by U.S. District Judge Linda Reade.

The agreement settles a civil enforcement action filed by the U.S. Commodity Futures Trading Commission alleging that U.S. Bank improperly allowed Peregrine founder Russell Wasendorf Sr. to misuse customer funds.

Wasendorf, the former CEO of the Iowa-based brokerage, is serving a 50-year prison term after he was convicted of stealing $ 215 million from thousands of customers over two decades. He carried out the fraud by repeatedly falsifying U.S. Bank records to fool regulators into believing that Peregrine’s customer account had more money than it did.

Although the commission had originally been seeking nearly twice as much, the $ 18 million settlement is still a positive development for thousands of investors who had accounts through Peregrine, which went by the nickname PFGBest. Many only have received 44 percent of what they had in accounts at the time of its collapse and that may now increase above 50 percent, said John Roe, co-founder of the Commodity Customer Coalition, a nonprofit advocating on their behalf.

“While you don’t get everything you want in litigation, the fact that we were able to get a substantial recovery for customers in a shorter time window is commendable,” he said. “It makes the best of a very bad situation.”

He said most of Wasendorf’s assets have been unwound, and the lawsuit represented “the last great pot of money available for PFG customers to go after.” The case also revealed a baffling lack of internal controls at U.S. Bank, he said.

The commission sued U.S. Bank in 2013, contending that it failed to follow rules requiring banks to safeguard the accounts of commodities investors. The commission contended that U.S. Bank improperly accepted customer funds as security on loans it made to Wasendorf and knowingly allowed him to transfer customer funds to pay personal and business expenses. The commission had sought $ 35.6 million in restitution — the amount that Wasendorf withdrew and transferred between 2008 and Peregrine’s collapse in 2012 — plus fines and penalties.

U.S. Bank had denied wrongdoing, contending it was unaware of Wasendorf’s fraud and was one of his victims.

Two employees responsible for managing Peregrine’s account testified in depositions they were unfamiliar with the concept of segregated accounts, a bedrock principle of futures trading, records show. The bank also had no policies, procedures or training on how to handle accounts from brokerage firms such as Peregrine, who help customers buy, sell and trade investments based on the future price of food and energy commodities.

The settlement stipulated that U.S. Bank — the lead bank of Minneapolis-based U.S. Bancorp — has since taken “significant remedial action to strengthen the internal controls and policies” governing such accounts.

The agreement was reached days before a trial set for last month. Jurors would have been asked to decide whether U.S. Bank had knowledge of Wasendorf’s wrongdoing or acted in bad faith by failing to investigate obvious indications of fraud.

CFTC enforcement director Aitan Goelman said Wasendorf was responsible for stealing “enormous sums of money that Peregrine’s customers entrusted to him.”

“However, that fact does not excuse U.S. Bank’s failure to meet its own responsibilities to safeguard Peregrine’s customer funds that it held,” he said.

Bank spokesman Dana Ripley said the company is pleased with the settlement, noting the payment is not considered a fine, penalty or admission of wrongdoing.