Image copyright PA

Five of the world's largest banks are to pay fines totalling $5.7bn (£3.6bn) for charges including manipulating the foreign exchange market.

Four of the banks - JPMorgan, Barclays, Citigroup and RBS - have agreed to plead guilty to US criminal charges.

The fifth, UBS, will plead guilty to rigging benchmark interest rates.

Barclays was fined the most, $2.4bn, as it did not join other banks in November to settle investigations by UK, US and Swiss regulators.

Barclays is also sacking eight employees involved in the scheme.

US Attorney General Loretta Lynch said that "almost every day" for five years from 2007, currency traders used a private electronic chat room to manipulate exchange rates.

Their actions harmed "countless consumers, investors and institutions around the world", she said.

Separately, the Federal Reserve fined a sixth bank, Bank of America, $205m over foreign exchange-rigging. All the other banks were fined by both the Department of Justice and the Federal Reserve.

Cartel threat

Regulators said that between 2008 and 2012, several traders formed a cartel and used chat rooms to manipulate prices in their favour.

One Barclays trader who was invited to join the cartel was told: "Mess up and sleep with one eye open at night."

Several strategies were used to manipulate prices and a common scheme was to influence prices around the daily fixing of currency levels.

A daily exchange rate fix is held to help businesses and investors value their multi-currency assets and liabilities.

Image copyright Getty Images Image caption US Attorney General Loretta Lynch said traders had colluded for five years

'Building ammo'

Until February, this happened every day in the 30 seconds before and after 16:00 in London and the result is known as the 4pm fix, or just the fix.

In a scheme known as "building ammo", a single trader would amass a large position in a currency and, just before or during the fix, would exit that position.

Other members of the cartel would be aware of the plan and would be able to profit.

"They engaged in a brazen 'heads I win, tails you lose' scheme to rip off their clients," said New York State superintendent of financial services Benjamin Lawsky.

The fines break a number of records. The criminal fines of more than $2.5bn are the largest set of anti-trust fines obtained by the Department of Justice.

The £284m fine imposed on Barclays by Britain's Financial Conduct Authority was a record by the regulator.

Meanwhile, the $925m fine imposed on Citigroup by the Department of Justice was the biggest penalty for breaking the Sherman Act, which covers competition law.

The guilty pleas from the banks are seen as highly significant as banks have settled previous investigations without an admission of guilt.

The Attorney General warned that further wrongdoing would be taken extremely seriously: "The Department of Justice will not hesitate to file criminal charges for financial institutions that reoffend.

"Banks that cannot or will not clean up their act need to understand - it will be enforced."

Image copyright Getty Images

Analysis: Kamal Ahmed, BBC business editor

If anyone in the City thought that the latest multi-billion pound fines for the banks meant that they were now out of the regulatory woods, they should think again.

The New York State Department of Financial Services is still investigating Barclays, for example, over other aspects of the foreign exchange market including electronic trading.

Barclays is also being investigated in the UK over its Qatari fund raising during the financial crisis and in America over the operation of its "dark pool" electronic trading business.

Other allegations include manipulating the energy markets in California and the US precious metal market.

For the Royal Bank of Scotland it is not a much rosier picture. The bank is facing a class action from major investors over whether it gave the correct information to the market during the financial crisis and is also facing an investigation into its mortgage business in the US.

Civil legal actions on foreign exchange manipulation are also in the offing for both banks.

It looks like the major global banks are going to face many more "we deeply regret this behaviour" days ahead.

'Regain trust'

Royal Bank of Scotland will pay fines totalling $669m (£430m) - $395m to the Department of Justice and $274m to the Federal Reserve - to resolve the investigations.

Ross McEwan, chief executive of RBS, said: "The serious misconduct that lies at the heart of today's announcements has no place in the bank that I am building.

"Pleading guilty for such wrongdoing is another stark reminder of how badly this bank lost its way and how important it is for us to regain trust."

Antony Jenkins, Barclays chief executive, said: "The misconduct at the core of these investigations is wholly incompatible with Barclays' purpose and values and we deeply regret that it occurred.

"I share the frustration of shareholders and colleagues that some individuals have once more brought our company and industry into disrepute."

Shares in Barclays gained 3.4% and RBS rose 1.8%.

The fines are "much lower than expected," said Chirantan Barua, an analyst at Bernstein Research in London. "No retroactive massive Libor fine for Barclays is a big positive, as is no reopening of the NPA (non-prosecution agreement).

"The fine came in £270m better than we expected for RBS, £850m better in the case of Barclays," he said.