Barclays has been fined £37.7m in a record punishment from the City regulator for failing to provide adequate protection for its clients' funds.

The Financial Conduct Authority (FCA) said Barclays put £16.5bn of client assets at unnecessary risk in the event that the bank had become insolvent.

It is the highest fine ever imposed by the FCA or its predecessor the FSA for client assets breaches, reflecting "significant weaknesses" in the systems and controls at the investment banking arm between 2007 and January 2012.

The regulator said Barclays had failed to apply lessons from previous enforcement actions, as well as numerous industry-wide warnings.

FCA director of enforcement Tracey McDermott said: "All firms should be clear after Lehman that there is no excuse for failing to safeguard client assets."

The fine, which comes three years after another Barclays subsidiary was penalised £1.1m for similar matters, relates to the period prior to the appointment of Antony Jenkins as the bank's group chief executive.

Barclays said it did not profit from the issue and no customers lost out.

In a statement, the bank said: "Barclays identified and self-reported to the FCA the issues giving rise to the FCA's findings and we accept their conclusion.

"Barclays has subsequently enhanced its systems to resolve these issues and to ensure we have the requisite processes in place. No client has suffered any loss as a consequence of this weakness in our processes which existed prior to January 2012."

JP Morgan was fined £33m for similar misconduct in 2010.

The FCA said Barclays' failure to safeguard funds meant clients risked incurring extra costs, lengthy delays or losing their assets if the bank had become insolvent.

FCA director of markets David Lawton said: "Safeguarding client assets is key to maintaining market confidence if firms fail - Barclays' lack of focus on the rules was unacceptable."

Two years ago, Barclays paid £290m to settle claims by UK and US regulators over the manipulation of Libor and Euribor interbank lending.

It is currently contesting charges in New York that it misled large institutional investors in the US by falsely telling them it was taking measures to protect them from predatory high-frequency traders.

And the Serious Fraud Office is looking at Barclays' dealings with Qatari officials during a cash call in the banking crisis of 2008.