NEW YORK/ZURICH- The U.S. government on Thursday filed a civil fraud lawsuit accusing UBS Group AG , Switzerland's largest bank, of defrauding investors in its sale of residential mortgage-backed securities leading up to the 2008 global financial crisis.

UBS was accused of misleading investors about the quality of billions of dollars of subprime and other risky mortgage loans backing 40 securities offerings, the Department of Justice said.

The lawsuit was filed after UBS rejected the government's proposal that it pay nearly $2 billion to settle, according to a person familiar with the talks who was not authorized to speak publicly about them.

UBS declined to comment on the lawsuit or the negotiations. It had said before the lawsuit was filed that it would contest the government's claims. 

A Justice Department spokesman did not immediately respond to a request for comment about the negotiations.

UBS' case is one of the last addressing alleged misconduct in the pooling and sale by large banks of mortgage securities that were a major cause of the financial crisis.

The Justice Department had previously settled similar claims against Bank of America Corp, Barclays Plc, Citigroup Inc , Credit Suisse Group AG , Deutsche Bank AG  , Goldman Sachs Group Inc , JPMorgan Chase & Co and Morgan Stanley.

It was not immediately clear how much UBS had set aside for a potential settlement, though analysts said they believed more than half of the 1.2 billion Swiss francs ($1.20 billion) the bank set aside for so-called non-core legal risks concerned the U.S. case.

UBS shares closed up 1.3 percent in European trading on Thursday.

(Additional reporting by Angelika Gruber in Zurich and Jonathan Stempel in New York; editing by Jane Merriman and Dan Grebler) ((Karen.Freifeld@thomsonreuters.com))