In the United States, global financial services firm Western Union has reportedly agreed to pay a fine of $586 million after admitting that it violated federal anti-money laundering laws by allowing its agents to send cash to criminals including those involved in illicit online gambling operations in Costa Rica.

According to a report from The Financial Times newspaper, the Thursday agreement with the United States Department Of Justice saw Western Union own up to criminal violations including the failure to maintain an effective anti-money laundering program and aiding and abetting wire fraud.

The newspaper reported that Western Union, which is based in the Denver suburb of Englewood, Colorado, admitted that its agents had “processed hundreds of thousands of transactions” for global fraud schemes including human trafficking rings in China between 2004 and 2012 while it additionally agreed to a deferred prosecution deal along with a related settlement with the Federal Trade Commission.

“As this case shows, wiring money can be the fastest way to send it; directly into the pockets of criminals and scam artists,” said David Bitkower, Principal Deputy Assistant Attorney General for the United States Department Of Justice.

The Financial Times reported that this is not the first time that Western Union has run afoul of federal anti-money laundering rules as 2005 saw the company enter into an agreement with the attorneys-general of 47 states and the District Of Columbia in order to resolve investigations into fraudulent transactions.

For its part, Western Union, which saw its share price drop by around 3.3% upon the publication of the deal, reportedly explained that it has created a new “fraud risk management unit” since 2012 and beefed up its anti-fraud technology while more than doubling its compliance staff. It moreover declared that it anticipated taking a hit of about $570 million as part of its fourth-quarter 2016 results in order to cover the costs and fees associated with the agreement.

“We worked hard to put these investigations behind us,” Bill Chandler, Chief Communications Officer for Western Union, told the newspaper.

As part of its deal with the United States Department Of Justice, which moreover resolved a previously undisclosed investigation being carried out by the United States Department Of The Treasury’s Financial Crimes Enforcement Network, Western Union will have its conduct monitored by an independent compliance auditor for the next three years.