European Union authorities fined four banks close to $400 million for manipulating the foreign-currency market by exchanging sensitive information and trading plans, including through an online chat room dubbed “Sterling Lads.”

HSBC Holdings PLC received the largest fine—€174 million, the equivalent of $197 million—followed by Credit Suisse AG, Barclays PLC and NatWest Group PLC, formerly known as Royal Bank of Scotland. UBS Group AG, which revealed the existence of the cartel formed by the banks, received full immunity, the...

European Union authorities fined four banks close to $400 million for manipulating the foreign-currency market by exchanging sensitive information and trading plans, including through an online chat room dubbed “Sterling Lads.”

HSBC Holdings PLC received the largest fine—€174 million, the equivalent of $197 million—followed by Credit Suisse AG , Barclays PLC and NatWest Group PLC, formerly known as Royal Bank of Scotland. UBS Group AG, which revealed the existence of the cartel formed by the banks, received full immunity, the European Commission said Thursday.

The fines wrap up a long-running EU investigation into foreign-exchange manipulation that has resulted in a total of €1.4 billion in fines to several banks.

The manipulation involved 11 currencies, including the euro, dollar and British pound, and took place in 2011 and 2012. It involved foreign-exchange spot order transactions, which are executed on the same day at the prevailing exchange rate. The commission, the EU’s executive arm, said some traders exchanged sensitive information and trading plans, occasionally coordinating them through the chat room.

“The collusive behavior of the five banks undermined the integrity of the financial sector at the expense of the European economy and consumers,” Margrethe Vestager, the EU commissioner in charge of competition policy, said in a statement.

Credit Suisse didn’t cooperate and was fined €83 million, the commission said. The bank, however, wasn’t held liable for all aspects of the case. A Credit Suisse spokesman declined to comment.

Credit Suisse previously said it didn’t believe its employees engaged in any conduct in currency markets that violated EU competition rules.

A spokesman for HSBC declined to comment.

A spokesman for NatWest, which was fined €32 million, said the misconduct involved one former employee of the bank.

“Our culture and controls have changed fundamentally during the past ten years and this kind of behaviour has no place at the bank we are today,” the spokesman said.

A Barclays spokeswoman declined to comment. A UBS spokesman said the bank was pleased the matter was resolved.

In 2019, the commission fined five banks, including Barclays and RBS, a total of €1.07 billion over the same issue. UBS also received full immunity in that case for revealing the existence of the cartels.

Write to Patricia Kowsmann at patricia.kowsmann@wsj.com