Global regulators imposed penalties totaling $3.4 billion on five major banks, including UBS (UBSN.VX), HSBC (HSBA.L) and Citigroup (C.N) on Wednesday for failing to stop their traders from trying to manipulate foreign exchange markets.

Royal Bank of Scotland (RBS.L) and JP Morgan (JPM.N) were also fined over attempts to rig currency benchmarks in a year-long probe that has put the largely unregulated $5 trillion-a-day market on a tighter leash, with dozens of dealers suspended or fired.

Switzerland's UBS swallowed the biggest penalty, despite being the first bank to come forward with evidence of possible misconduct, paying $661 million to Britain's Financial Services Authority (FCA) and the U.S. Commodity Futures Trading Commission (CFTC).

UBS was ordered by Swiss regulator FINMA, which also said it had found serious misconduct of the bank's employees in precious metals trading, to hand over 134 million Swiss francs.

FINMA also instructed Switzerland's largest bank to automate at least 95 percent of its global foreign exchange trading and limit bonuses for traders of foreign exchange and precious metals, where it said it had also found evidence of serious misconduct, to 200 percent of their base salary for two years.

Other UBS high earners will have to get approval for their bonuses to go above that.

Regulators found evidence that traders had colluded to try and manipulate benchmark foreign exchange rates by sharing confidential information about client orders with one another right up until October 2013.

The traders used code names to identify clients without naming them and created online chatrooms with monikers such as "the players", “the 3 musketeers” and “1 team, 1 dream” in which to swap information.

The financial regulator in London, the global hub for foreign exchange (FX) trading, said it had launched a review of the spot FX industry that will require firms to scrutinize their systems and may involve them looking at how they do things in other markets such as derivatives and precious metals.

The FCA's first group settlement, worth more than $1.7 billion, is the biggest in British history and eclipses the 460 million pounds fines for alleged interest rate manipulation, reflecting increasing political and public demands that banks -- blamed for sparking the 2008 credit crisis -- are held accountable.

The five banks earned a 30 percent discount for agreeing to settle early.

"Today’s record fines mark the gravity of the failings we found and firms need to take responsibility for putting it right," the FCA's Chief Executive Martin Wheatley said.

"They must make sure their traders do not game the system to boost profits or leave the ethics of their conduct to compliance to worry about."

Barclays (BARC.L) had been expected to be part of the settlement but the FCA said its investigation into the UK bank was continuing.

"Nice team work"

Investors had been braced for a speedy conclusion to the investigation after an earlier, sprawling inquiry into alleged rigging of interest rate benchmarks such as Libor gave regulators experience in how to cooperate globally.

In its settlement with HSBC, the FCA said that after attempts to manipulate one sterling/dollar currency fix that netted a $162,000 profit, traders congratulated one another, saying "nice work gents... I don my hat" and "Hooray nice team work".

Under instruction from increasingly intrusive regulators, banks did much of the groundwork themselves, handing over reams of online transcripts, clamping down on chatroom use and either suspending or firing more than 30 foreign exchange traders.

FINMA said it has started enforcement proceedings against 11 former and current employees of UBS

With the UK settlement out of the way, the focus shifts to ongoing U.S. and UK criminal investigations and potential civil law suits.

The CFTC, which regulated swaps and futures in the United States, fined the five banks more than $1.4 billion but that does not resolve probes by the U.S. Department of Justice and the New York's Department of Financial Services.

The FCA fines come days before world leaders are expected to sign off on proposals to reform currency markets when they meet at the G20 summit in Brisbane.

The foreign exchange probe proved particularly uncomfortable for British authorities because it cast a shadow over London's credentials as the world center for foreign exchange trading, and also ensnared the Bank of England whose head Mark Carney is leading global regulatory efforts to overhaul the FX market.

The Bank of England said an internal probe had found no evidence that any of its officials had been involved in unlawful or improper behavior.

The Bank has fired its chief foreign exchange dealer after it found information about serious misconduct, but said the dismissal was unrelated to a foreign exchange scandal.