Image caption The regulator alleges firms and individuals acted "improperly"

US authorities are to sue 17 major banks for losses on mortgage-backed investments that cost taxpayers tens of billions of dollars.

The Federal Housing Finance Agency said it was taking action against banks including Goldman Sachs, Barclays, Bank of America, Deutsche Bank, and HSBC.

The agency says they misrepresented the quality of the mortgages they sold during the housing bubble.

The values plunged as the US was engulfed in the financial crisis.

The FHFA oversees mortgage giants Fannie Mae and Freddie Mac.

The two firms lost more than $30bn (£18.5bn), partly because of their investments in the subprime mortgages, and were bailed out by the US government.

Since the rescues, US taxpayers have spent more than $140bn to keep the firms afloat.

Other banks facing action include Royal Bank of Scotland, Nomura, Citigroup, and Societe Generale.

A spokesman for RBS said: "We believe we have substantial and credible legal and factual defences to these claims and will defend them vigorously."

Speculation in recent days that the FHFA was about to launch legal action had led to falls in US bank share prices.

The FHFA said in a statement that there had been "improper actions by the firms and individuals".

"Based on our review, FHFA alleges that the loans had different and more risky characteristics than the descriptions contained in the marketing and sales materials provided to the Enterprises for those securities," the statement said.

Major banks are already negotiating with the attorneys general of all 50 states to settle mortgage abuses.

The banks were looking for a comprehensive deal that would protect them from future litigation.

But the FHFA's action may complicate attempts to reach a deal with the states.