Five major banks agreed on Wednesday to pay more than $5 billion in fines and plead guilty to felony charges of rigging foreign currency markets and Libor interest rates.

Citigroup, JPMorgan Chase, Barclays and the Royal Bank of Scotland acknowledged their traders routinely manipulated the $5.3-trillion-a-day foreign exchange currency market by rigging the foreign exchange prices of U.S. dollars and euros for several years since 2007, the Justice Department said.

The banks agreed to "plead guilty to conspiring to manipulate the price of U.S. dollars and euros exchanged in the foreign currency exchange (FX) spot market and the banks have agreed to pay criminal fines totaling more than $2.5 billion," according to the Justice Department.

Those four banks, along with UBS, were also fined $1.6 billion by the Federal Reserve. UBS will also pay a $203 million penalty for manipulating the Libor rates, and Barclays will pay an additional $1.3 billion to settle similar claims.

“The penalty these banks will now pay is fitting considering the long-running and egregious nature of their anticompetitive conduct,” said U.S. Attorney General Loretta Lynch. “It is commensurate with the pervasive harm done. And it should deter competitors in the future from chasing profits without regard to fairness, to the law, or to the public welfare.”

While the traders at the first four banks were supposed to be competitors, Lynch said the bankers padded profits by working together to manipulate the largest, but least regulated, financial market in the world. Trading in that market is five times larger than trading on all global stock exchanges combined, according to officials.

"Starting as early as [December] 2007, currency traders at several multinational banks formed a group dubbed 'The Cartel'. It is perhaps fitting that those traders chose that name, as it aptly describes the brazenly illegal behavior they were engaging in on a near-daily basis," Lynch said, according to USA Today.

“They acted as partners - rather than competitors - in an effort to push the exchange rate in directions favorable to their banks but detrimental to many others," she said. The traders conspired to enrich themselves at the expense of “countless consumers, investors and institutions around the world,” Lynch added.

Bankers working in the cartel operated in exclusive invitation-only chat rooms and used coded language to coordinate their trades, which manipulated benchmark exchange rates for the dollar and euro to benefit their own trading positions, according to prosecutors.

"By agreeing not to buy or sell at certain times the traders protected each other's trading positions by withholding supply of or demand for currency and suppressing competition in the FX market," the Department of Justice said.

It's not clear exactly how much the bankers profited from their manipulation, and as of now, it appears as if no prison time will be served.