A state judge has dismissed a lawsuit by former students of a elite Brooklyn prep school against the school’s outside counsel for allegedly trying to “deceive” a federal court in a now-settled action challenging the school for an alleged covering up sexual abuse by a coach.

Most of the former students and summer camp participants sued O’Melveny & Myers and Jeffrey Kohn, managing partner of its New York office, asserting the attorneys had to be held accountable for “their grievous and oft-repeated falsehoods” in the high-profile Eastern District case against Poly Prep.

The plaintiffs claimed in their post-settlement action that the firm violated state Judiciary Law §487, which forbids attorneys’ “deceit or collusion, with intent to deceive the court or any party.”

The firm insisted it offered “legitimate advocacy.” Besides, it added, plaintiffs could have pressed ahead with their misrepresentation claims in federal court but “voluntarily abandoned” the matter and could not now re-litigate.

On Friday, Manhattan Supreme Court Justice Manuel Mendez (See Profile) granted the firm’s dismissal motion in Zimmerman v. Kohn, 652826/2013. “Plaintiff’s exclusive remedy was to address the violation of Judiciary Law §487 in the [Eastern District]” he said.

O’Melveny is represented by Debevoise & Plimpton partners Matthew Fishbein, Jyotin Hamid and Helen Cantwell. In a statement, Fishbein said “We are gratified by the court’s thoughtful and just disposition of this regrettable case.”

Kevin Mulhearn of Orangeburg, who represented the plaintiffs in the federal and state case, said he would appeal Mendez’s decision. “The same case requirement that he said was part of the law just doesn’t exist,” said Mulhearn.