In a stunning development, the Queens and Bronx Republicans leaders have withdrawn support for Anthony Pappas, their congressional candidate against Democratic socialist Alexandria Ocasio-Cortez, after he admitted that his ex-wife accused of him domestic violence and took out a restraining order.

Pappas also told Queens GOP chairwoman Joann Ariola and Bronx leader Michael Rendino that he put $1,200 in his campaign account — but the government froze it because he owed his ex-wife at least $1 million following their divorce.

Both party leaders told The Post that Pappas was “unhinged.”

But his name will stay on Tuesday’s ballot because it’s too late to get it removed.

Pappas, a 72-year-old university professor, had expected to face longtime Rep. Joe Crowley in the 14th congressional district that includes parts of Queens and The Bronx.

But Ocasio-Cortez startled the political world by ousting Crowley in June’s Democratic primary.

GOP leaders set up a conference call with Pappas in early September after learning he hadn’t raised any money and was slow to put up a website.

That’s when he dropped the bombshells.

“Pappas said he opened a campaign account with $1,200 but he couldn’t spend the money because he owed $1.5 million to his ex-wife as part of a divorce settlement. We were shocked,” Ariola recalled.

“Pappas said, ‘My wife said I beat her and there was a restraining order.’ We said, ‘Based on what you told us we can’t support you for this congressional seat,’” Ariola recalled.

In a freewheeling interview with The Post, Pappas confirmed the restraining order and conceded he owed at least $1 million.

He denied beating his wife but admitted he was involuntarily committed three times.

“I was lamenting my persecution, [by the judge in the divorce case]” he said.

Pappas is an associate professor of economics at St. John’s University.

In a previous Post interview, Pappas repeatedly brought up his court case.

Pappas’ divorce case was settled in 2014 and the restraining order remains in effect, he said.

Asked about the domestic violence accusations, Pappas said, “This is something the judge hallucinated on himself… feeling perhaps that he had to be politically correct.”

The GOP’s desertion of Pappas was first reported by The Bronx Times.

Ariola, the GOP leader, said a “lesson was learned” and the party will conduct independent background checks on all future candidates.

Ariola said she now gets “harassing” emails from Pappas, adding, “our conservations with Mr. Pappas are over.”

Pappas for Congress raised $1,935 — and spent nothing, according to campaign reports filed with the Federal Elections Commission.