Barclays has agreed to pay $2bn (£1.4bn) to settle a US civil action related to the mis-selling of residential mortgage-backed securities in the run-up to the financial crisis.

Two former Barclays executives also agreed to pay $2m to resolve claims brought against them, the US Department of Justice said on Thursday.

The complaint, filed in December 2016, alleged that Barclays caused billions of dollars in losses to investors by engaging in a fraudulent scheme to sell $31bn-worth of the securities, and that it misled investors about the quality of the mortgage loans backing those deals.

The complaint alleged that Barclays’ investment banking division, Barclays Capital, had committed mail fraud, wire fraud, bank fraud and other misconduct. 

Securities backed by sub-prime housing debt sold by Barclays and many other banks were the major trigger of the 2007-2008 financial crisis.

Barclays did not admit liability in the case.

“This settlement reflects the ongoing commitment of the Department of Justice, and this office, to hold banks and other entities and individuals accountable for their fraudulent conduct,” stated US attorney Richard Donoghue.

“The substantial penalty Barclays and its executives have agreed to pay is an important step in recognising the harm that was caused to the national economy and to investors in residential mortgage-backed securities.”

Jes Staley, Barclays’ chief executive, said the bank was “pleased that we have been able to reach a fair and proportionate settlement”.

He added: “It has been a priority for this management team from the start to resolve these historic issues in a timely and appropriate manner wherever possible.

“The completion of our restructuring in 2017, and putting significant legacy matters like this one behind us, mean Barclays is well positioned to produce stronger earnings going forward, and to start returning a greater proportion of those earnings to our shareholders over time.”