A lawsuit from New York's attorney general accusing accounting firm Ernst & Young LLP of helping to hide financial problems at Lehman Brothers Holdings Inc. has been sent from federal court to the New York state court where it was originally filed.

U.S. District Judge Lewis Kaplan said in a ruling Thursday that the lawsuit, which alleges that Ernst & Young conspired with Lehman in a scheme to shuffle tens of billions of dollars from its balance sheets in order to boost the appearance of Lehman's liquidity, does not fall under federal jurisdiction.

This action therefore will be remanded whence it came, Kaplan wrote, referring to the Manhattan state court where the lawsuit was initially filed by New York's then-Attorney General Andrew Cuomo.

The lawsuit is one of the first major government legal action stemming from Lehman's 2008 bankruptcy filing. In it, New York prosecutors cite violations of the Martin Act, a 90-year-old state law that gives regulators broad enforcement authority over securities fraud.

After the lawsuit was filed in December 2010, Ernst & Young moved it to federal court in Manhattan. While Cuomo's successor, Eric Schneiderman, initially opposed the move, the state later dropped its objections.

The case has been consolidated with 47 others related to the Lehman collapse. Sending it back to state court may make the discovery process less efficient, Kaplan wrote.

But the court nonetheless has come to the view that remand of this action is the only course open to it in the present posture of this case, Kaplan wrote.

The lawsuit seeks to recoup the $150 million in fees that Ernst & Young earned as Lehman's auditor from 2001 until its bankruptcy filing in 2008.

Ernst & Young has denied it acted improperly and said that Lehman's accounting complied with national standards. In his ruling, Kaplan noted that whether Ernst & Young complied with national accounting standards was the sole federal-law question in the attorney general's lawsuit.

But Kaplan found that the state may obtain all the relief it seeks without reaching the question of whether Ernst & Young violated those standards.

We are disappointed by the court's ruling, and we are reviewing it, Ernst & Young spokesman Charlie Perkins said in a statement. We will continue to vigorously defend ourselves in the matter.

A spokesman for the New York Attorney General did not immediately return a request for comment Thursday.

The case is New York v. Ernst & Young LLP, U.S. District Court, Southern District of New York No. 11-00384.

(Reporting by Jessica Dye; Editing by Gary Hill)