Four big banks will pay $2.5 billion in fines and plead guilty to criminally manipulating the global currency markets going back to 2007.

JPMorgan Chase, Citigroup, Barclays and The Royal Bank of Scotland conspired with one another to fix rates on U.S. dollars and euros traded in the huge global market for currencies, according to a settlement announced Wednesday between the banks and U.S. Justice Department. Currency traders allegedly shared customer orders through chat rooms and used that information to profit ahead of their clients.

The criminal behavior took place between December 2007 and January 2013, according to the agreement.

Another bank, UBS, has agreed to plead guilty to manipulating key interest rates and will pay a separate $203 million criminal penalty.