Authorities have fined five of the world's largest banks, including JP Morgan Chase & Co and Citigroup, roughly $5.7 billion.

Four banks pleaded guilty to trying to manipulate foreign exchange rates, ending a global probe into misconduct in the $5 trillion a day market. 

Authorities in the United States and Britain accused traders at Citigroup, JP Morgan, Barclays, UBS and Royal Bank of Scotland of brazenly cheating their clients to boost their own profits using invitation-only chatrooms and coded language to coordinate their trades.

The misconduct occurred up until 2013, after regulators had started punishing banks for rigging the London interbank offered rate (Libor), an interest rate benchmark, and banks had pledged to overhaul their corporate culture and bolster compliance.

In total, authorities in the US and Europe have fined seven banks over $10 billion for failing to stop their dealers from trying to manipulate foreign exchange rates – used every day by millions of people from trillion dollar investment houses to tourists buying foreign currencies for their holidays.

Barclays faced the biggest fine with a penalty of $2.4 billion because it did not join in an earlier November settlement with UK and some US authorities due to complications with its regulator in New York. 

Barclays fired eight employees as part of its settlement and New York's Superintendent of Financial Services warned that it was still probing the bank's use of electronic systems for foreign exchange trading, which make up the vast majority of transactions in the market.

“Put simply, Barclays employees helped rig the foreign exchange market. They engaged in a brazen ‘heads I win, tails you lose’ scheme to rip off their clients," Benjamin Lawsky said in a statement. 

"While today's action concerns misconduct in spot trading, there is additional work ahead," he added.

Barclays had set aside $3.2 billion to cover any forex related settlement. 

Swiss bank UBS, which avoided a guilty plea over the forex debacle, pleaded guilty instead to one count of wire fraud and will pay a $203m fine for its role in rigging Libor after its involvement in the forex scandal breached an earlier Department of Justice agreement. 

Switzerland's largest bank also had to pay $342m to the Federal Reserve over attempted manipulation of forex rates. 

The US Fed fined six banks for unsafe and unsound practices in the foreign exchange markets, including a $205m fine for Bank of America, which, like UBS, avoided a guilty plea. 

UBS's penalty was lower than expected and this contributed to a more than 3% rise in UBS shares to their highest level in six and a half years. 

The global investigation into manipulation of foreign exchange rates has put the largely unregulated forex market on a tighter leash and accelerated a push to automate trading. 

Authorities in South Africa announced this week they were opening their own probe. 

Transcripts of online chat rooms made public today demonstrated the clubby, audacious nature of the dealing desks with one employee at Barclays remarking, "If you aint cheating, you aint trying."