NEW YORK (Reuters) - A federal judge on Tuesday rejected UBS Group AG’s bid to dismiss a U.S. government lawsuit accusing Switzerland’s largest bank of causing “catastrophic” investor losses in residential mortgage-backed securities sold before the 2008 financial crisis.

FILE PHOTO: A man walks past a UBS logo projected on a screen in Singapore, January 14, 2019. REUTERS/Feline Lim

U.S. District Judge Margo Brodie in Brooklyn, New York, said the Department of Justice sufficiently alleged that from 2005 to 2007, UBS intended to defraud or acted recklessly toward investors who bought securities backed by more than $41 billion of subprime and other risky loans in 40 offerings.

Many of the loans were made by now-defunct lenders including Countrywide Home Loans, American Home Mortgage, Fremont Investment & Loan, IndyMac and New Century.

The Justice Department said UBS securitized the loans despite internal communications acknowledging that the lenders’ underwriting standards had been “severely deteriorating.”

A lawyer for UBS declined to comment on the decision.

The government did not specify damages in its November 2018 lawsuit, but said investors “lost many billions of dollars, with substantially more in losses projected during the remaining life of the deals.”

It said UBS’ conduct violated a 1989 law allowing the government to seek civil penalties equal to the losses suffered by others resulting from a violation. Brodie did not decide the merits of the government’s case.

The case is among the last targeting big banks over the packaging and sale of risky, poorly underwritten loans into securities, which was a major cause of the financial crisis.

Several major U.S. and European banks have settled similar claims.

The case is U.S. v. UBS Securities LLC, U.S. District Court, Eastern District of New York, No. 18-06369.