The German bank was accused by the Federal Housing Finance Agency, which oversees Freddie Mac, of misrepresenting the underwriting and quality of home loans backing the securities in the trust, which dated from 2006.

Freddie Mac bought nearly one-third of the securities, which lost much of their value amid the U.S. housing and financial crises.

The lawsuit is barred by New York state's six-year statute of limitations, Justice Eileen Bransten ruled in a filing Wednesday in State Supreme Court in Manhattan.

The dismissal came after a New York appeals court ruling in December that the clock on the statute of limitations began to run when the transaction was executed in 2006.

FHFA began the lawsuit in 2012, just within the six years, but the agency did not have standing to sue.

HSBC Bank USA, National Association, the trustee overseeing the securities, was the party allowed to bring the claims, but it did not join the case until January 2013, which was too late, the judge said.

A spokesman for the trustee had no immediate comment. Nor did an FHFA spokeswoman. A Deutsche Bank representative declined to comment.

New York's Appellate Division, First Department, ruled in December that the clock starts on the closing date of the mortgage loan purchase agreements, not when a bank refuses to cure or repurchase faulty loans. Its ruling came in a case Ace Securities Corp brought against Deutsche Bank.

In the Ace case, the bondholders also later substituted the trustee as plaintiff, but that did not make the complaint timely, the appeals court said.

In a separate decision filed on Wednesday, Justice Bransten allowed another case brought by HSBC, as trustee of a $702 million Ace Securities Corp Home Equity Loan Trust, to go forward, denying some elements of Deutsche's motion to dismiss.

Deutsche Bank in December agreed to pay $1.9 billion to settle claims that it misled Fannie Mae and Freddie Mac, America's biggest providers of housing finance, into buying $14.2 billion in mortgage-backed securities.

The case is Federal Housing Finance Agency v DB Structured Products, New York State Supreme Court, New York County, No. 652978/2012.

(Editing by Jonathan Oatis)

By Karen Freifeld