The Bernie Sanders campaign is saying no to war —...

A beloved Upper East Side nursery school — its finances allegedly trashed by the cuckolded schoolmaster’s crooked husband — closed its doors for good Friday.

The Epiphany Community Nursery School on East 74th Street, founded by Wendy Levey 45 years ago, served 123 students. Tuition was $35,300 a year.

Levey and the board have “been trying to … find a way to stay open in the building until May. But since we did not raise sufficient funds to cover essential operating expenses, there is no realistic way to work out a deal to remain operational,” a notice on the school’s website read.

While parents praised its programs and Levey’s knack for getting kids accepted into elite private schools, there was drama behind the scenes.

Levey’s then-husband Hugh Levey, a Harvard MBA and investment banker, was accused in a 2016 lawsuit by Epiphany of “looting” millions from the school.

Beginning in the late 2000s, Levey allegedly perpetrated “a massive fraudulent scheme” along with his alleged mistress, TV talking head Claire Gruppo, to steal $8 million from the non-profit, legal papers say.

Some of the money was transferred into an account for Gruppo’s personal use and for an upstate farmhouse used by Levey and his paramour, legal papers say.

The alleged affair was made public in 2015 as part of another lawsuit over a bad investment deal. The Leveys divorced in 2016.

The case against him by Epiphany was dismissed in 2017 because the claims exceeded the statute of limitations.

But the school’s board approved a “restitution settlement” in March 2018 and received a $1 million payment for “claims in connection with the diversion of funds for personal benefit,” according to the Epiphany’s tax filing. The filing does not mention Hugh Levey or say who made the payment.

Levey could not be reached for comment and his lawyers did not return requests for comment.

Wendy Levey would not comment on what impact her ex-husband’s alleged actions had on the school’s closing.

She said Epiphany was hurt by the implementation of the city’s universal pre-kindergarten program, which provides free preschool, a dip in the number of young children, and a “huge rent.”

The school’s board in November said it needed more than $250,000 to stay open through May, and had raised $73,000.

Todd Griesman, whose children attended the school many years ago, started a GoFundMe campaign in December to help Epiphany bring in extra cash, but it raised only $8,800.

He said the school fostered community involvement with events like class picnics for parents and kids, pancake breakfasts and book clubs.

“Wendy really, really pushed a whole sense of ‘we help each other out,’ ” Griesman said.

But that help seemed to fall apart at the end.

Griesman posted a sarcastic message on the school’s Facebook page to “thank” members of the advisory board of past and present parents “who chose to stay absolutely silent and make absolutely no donation of time or money. What a great job! ‘Thanks’ Appreciated the Apathy!”