A Long Island community is suing a former town lawyer for negligence and malpractice, claiming he let a crooked businessman get away with a fraud scheme that cost it millions.

The town of Oyster Bay filed the lawsuit against ex-town attorney Leonard Genova in Nassau County last week. It alleges that Genova was complicit in the fraudulent activities of restaurateur Harendra Singh, who was the star witness at the May corruption trial of ex-Nassau County Executive Ed Mangano.

Singh was awarded contracts with Oyster Bay and was expected to make improvements to local facilities, taking out $20 million in loans that were guaranteed by the town.

But Singh used the loans “to line his own pockets rather than improve town facilities,” and the community was left on the hook for the money, according to the court documents.

While testifying at Mangano’s trial, Genova — who held his job from Nov. 2011 to Jan. 2018 — admitted to taking bribes from Singh and signing a town contract with the businessman that he hadn’t even reviewed. Genova received immunity for his testimony. In addition, Deputy Town Attorney Frederick Mei has pleaded guilty to receiving payoffs from Singh.

“During Genova’s watch, a complex conspiracy was hatched… Genova did not merely fail to detect the Singh/Mei conspiracy but, in fact, committed outrageous acts of gross incompetence, malpractice, malfeasance, and gross negligence,” the suit states.

The lawsuit further charges that Genova’s testimony “indicates that he was wholly derelict in his duties by failing to oversee his office, by failing to exercise the level of care that any prudent Town attorney would exercise, and that he engaged in other wrongful acts for which the town should be compensated.”

The town wants to recoup Genova’s $140,000 yearly salary for the six-year period of the scheme and also wants to be paid back for the legal and investigative fees it incurred.

“The town found itself embroiled in a legal and investigative morass, and has been left to pick up the pieces all while protecting taxpayers from the fallout of the corrupt scheme,” according to the court papers.

Oyster Bay Town Supervisor John Venditto and Mangano were charged in 2016 with taking hundreds of thousands in bribes from Singh in exchange for contracts and loan guarantees.

Singh took a plea deal and testified at Mangano’s trial about bribing multiple people including Mangano, Venditto and New York City Mayor Bill de Blasio.

Venditto was acquitted on the charges and a deadlocked jury resulted in a mistrial for Mangano and his wife Linda, whose retrial is set for October. De Blasio has not been charged with wrongdoing.

The current Oyster Bay town lawyer who filed the suit, Joseph Nocella, said, “The town has an obligation to its taxpayers to recover money that is lost by the self-confessed gross negligence and illegal acts of its former employees.”

Genova’s lawyer, Nicholas Gravante Jr., said the lawsuit was filed in retaliation for his client’s testimony against Venditto.

“The allegations are based purely on Mr. Genova’s testimony at the Mangano trial. Mr. Genova intends to aggressively defend the action which seeks damages that dramatically overstate the harm, if any, that this conduct caused the town of Oyster Bay,” Gravante Jr. said.