Mayor de Blasio is getting hit on Monday with three new lawsuits by charter-school supporters, his traditional enemies — just as his pals who despise the popular institutions are threatening him with legal action for offering a compromise.

The Success Academy, a charter-school network run by his nemesis Eva Moskowitz, is filing a federal civil-rights lawsuit to overturn his decision to disallow its Central Harlem middle school from sharing space with a public school.

Opening a second front, Success officials are going to Albany to file papers with state Education Commissioner John King to try to reverse City Hall’s decision to keep two new Success Academy elementary schools from opening.

One is scheduled for shared space at Murry Bergtraum HS downtown and the other at August Martin HS in Queens.

All three co-locations had been approved last year by then-Mayor Mike Bloomberg.

Facing a firestorm of criticism, de Blasio and Schools Chancellor Carmen Fariña have begun backing off.

On Friday, Fariña apologized for saying displaced charter-school students were “on their own.”

She now is promising to find alternate space in the fall for the Harlem middle-school students who would be displaced by her decision to toss them out of the PS 149/Sojourner Truth facility.

The charter school is temporarily sharing space at another Harlem school building but must vacate in June.

De Blasio, meanwhile, tried to dance around the controversy, focusing instead on his pre-kindergarten initiative.

“We have to work with every kind of school,” the mayor told worshippers at Heavenly Visions Church in The Bronx Sunday .

“I believe that every kind of school can help us make our children stronger — all the different kinds of public schools, the charter schools, the religious schools.

“The religious schools are going to be part of our pre-K plan, part of our after-school plan. Because we’re all in this together.”

The mayor’s let’s-embrace-all approach came a day after one of his usual allies, Public Advocate Letitia James, criticized him for not doing enough to curb the growth of charters.

James said she would sue to shut down all co-located charter schools and ask a judge to suspend their admissions lottery for the 2014-15 academic year — at least until a decision in reached in the case.

De Blasio — who had signed off on 14 of the 17 sharing arrangements approved by Bloomberg — acknowledged he is getting flak from both sides.

“If the public advocate wants to file a lawsuit, that’s her right,” de Blasio said.

Fariña echoed the sentiment, saying James “operates under her own jurisdiction.”

De Blasio, whose poll numbers have been slipping, hopes to get a boost from parents at the Harlem public school who will rally Monday in support of his decision to shut out Success Academy.

Parents and teachers said the public school would have lost space for special-needs children.

Meanwhile, NAACP President Hazel Dukes put out a statement blasting the Success Academy suit against De Blasio.

“This lawsuit is an outrageous and insulting attempt by Wall Street hedge fund managers to hijack the language of civil rights in their shameless political attack on Bill de Blasio,” she wrote.

Some 70,000 city students attend 183 charters, which are opposed by the teachers union because most aren’t unionized.

Additional reporting by Elizabeth Hagen