Five of the world’s largest banks agreed to pay almost $3.4 billion in fines to settle allegations that they manipulated benchmark prices in the foreign exchange market.

The settlement is the end of a the first stage of a scandal similar to the one over manipulation of benchmark interest rates such as the London Interbank Offered Rate, and further evidence of wholesale misconduct in the dealing rooms of London and New York over a period of more than five years. Records unearthed by the U.K.’s Financial Conduct Authority and the Commodities and Futures Trading Commission showed that some of the banks continued to manipulate the FX market even while they were under investigation for rigging Libor.

The banks affected are Citigroup C , which was fined a total of $668 million, JP Morgan Chase Inc. JPM ($662 million), Switzerland’s UBS AG UBS ($800 million), Royal Bank of Scotland Plc RBS ($634 million) and HSBC Holdings Plc HBC ($618 million).

Barclays Plc BCS , which had also been under investigation, said it had pulled out of the collective settlement because “after discussions with other regulators and authorities, we have concluded that it is in the interests of the company to seek a more general coordinated settlement.”

The deal is far from the end of a scandal that first came to light just over a year ago. Neither the Federal Reserve, the Department of Justice, the Office of the Comptroller of the Currency or New York’s Department of Financial Services are party to the deal. Other banks are still under investigation. Bank of America BAC and Deutsche Bank AG both took substantial charges against third-quarter earnings recently, partly in relation to the same scandal.

In addition, some banks will also face civil suits from customers that suffered from the manipulation, while a number of individual traders are facing criminal investigations. Around three dozen have already been fired or suspended and many more have left their respective banks under pressure from the investigation.

The regulators discovered that traders at the banks had used private chat rooms to share information about their clients’ orders in trading leading up to the daily “fixings” which provide reference rates for the $5.3 trillion a day global foreign exchange market. Using monikers such as “The Cartel” and “The A-team”, the traders routinely used that information to increase their own profits at the expense of their clients.

“The setting of a benchmark rate is not simply another opportunity for banks to earn a profit,” CFTC director of enforcement Aitan Goelman said in a statement. “Countless individuals and companies around the world rely on these rates to settle financial contracts…The market only works if people have confidence that the process of setting these benchmarks is fair, not corrupted by manipulation by some of the biggest banks in the world.”

The scandal has been the severest test yet for the new regulatory bodies set up after the crisis by the U.K., whose “light-touch” regulation has been blamed for allowing corruption and excess to spread unchecked through the world’s largest financial marketplace in the years before the 2008 crisis.

The F.C.A. has been under intense pressure from both the U.K. government and its counterparts in the E.U. and U.S. to prove its mettle, and it has been criticised for rushing to complete the probe, which depended to a large extent on evidence collected by the banks themselves (the banks got 30% knocked off their fines for their cooperation) . A spokeswoman rejected suggestions that the investigation hadn’t been thorough enough, saying 70 staff had been employed on the matter.

But the buck didn’t stop at the private banks. The Bank of England also confirmed Wednesday that it had fired its chief foreign exchange dealer, who was criticized in a separate report for failing to report what he knew about “collusive” practices in the market to his superiors. A Bank spokesman said Martin Mallett hadn’t been dismissed for that, but rather for other misconduct that had come to light in the course of the investigation.

NOTE: The original version of this article mis-stated the total fines paid by the banks. This has now been corrected.