WASHINGTON – A judge who questioned whether Barclays Bank PLC was getting off too easily nonetheless approved a deal Wednesday that will likely enable the financial institution to avoid prosecution on allegations that it engaged in $500 million in illegal transactions with banks in Cuba, Iran, Libya, Sudan and Myanmar for more than a decade.

Under the arrangement with the Justice Department, Barclays will pay $298 million. The two criminal charges the bank faces will be deferred and ultimately dropped as long as the London-based bank demonstrates that it is complying with U.S. laws.

No one working at the bank was charged criminally, and the $298 million is coming out of the pockets of Barclays’ shareholders.