Anthony Scaramucci’s divorce is turning nasty, because he believes the newborn son whose birth he missed during his historically-brief tenure in the White House is not his – and he is demanding a paternity test.

A source tells Page Six The Mooch believes estranged wife Deidre Ball could have been impregnated by someone else while he was away building his now famously-failed political career for President Donald Trump.

Deidre, we are told, is horrified by the claim and insists the child is Scaramucci’s. And she has upped the stakes by hiring top Manhattan divorce attorneys Bernard Clair and Dan Rottenstreich from the powerful firm Cohen Clair Lans Griefer Thorpe & Rottenstreich LLP in order to make mincemeat of The Mooch in court.

A source exclusively told us, “Things are heating up in the divorce. He doesn’t believe that child is his.

“He is actually contesting the paternity of the newborn, which is the same as dropping a hand grenade into any divorce action and possible amicable resolution, and Deidre strongly rejects his claim.

“You don’t make that sort of claim unless you are nuts. He will be easily proven wrong.”

The source added that the paternity test had not been done yet, as it would be ordered by the judge presiding over the case in an upcoming hearing.

Page Six exclusively revealed in July that fed-up Deidre, 38, had filed for divorce when she was nine months pregnant on July 6 at the Nassau County Supreme Court near their Manhasset home.

She gave birth to their second son, James, in late July, two weeks early, and he was admitted for a short time to the neo-natal unit at Lenox Hill Hospital.

Then-White House communications director Scaramucci didn’t come home until six days after the child’s birth and sent a text to his wife in the hospital saying, “Congratulations, I’ll pray for our child.”

They also have son Nicholas, 4, while he has two older children from a previous marriage.

Shortly afterward, Scaramucci was fired by Trump after just 11 days in the job, following an astonishing outburst against Steve Bannon and Reince Priebus to a New Yorker reporter.

The Mooch’s attorney Leonard Sperber didn’t return multiple calls for comment. Scaramucci’s rep told us in a statement, “Mr. Scaramucci looks forward to resolving this case through appropriate legal channels with her chosen legal counsel.” He declined to comment on the paternity issue.

Deidre filed a notice with the Nassau County Supreme Court on Wednesday about her high-profile attorney change. Clair has previously represented Bill O’Reilly in his divorce and is currently counsel in the divorce trial for Melissa Schiff against her estranged husband, billionaire George Soros’ son Robert. Rottenstreich is currently representing real estate titan Harry Macklowe against his wife of 57 years, Linda, in their explosive divorce trial. Both Clair and Rottenstreich declined to comment Wednesday night.

Meanwhile, The Mooch and his rumored romantic interest, Fox News star Kimberly Guilfoyle, were spotted lurking in the same corner of the Us Weekly Most Stylish party at the Jane Ballroom on Tuesday night, refusing to be photographed together.

Scaramucci and “The Five” star strongly denied they were an item earlier this month after Showbiz 411 reported that they had gone “co-op shopping” before his divorce. A source close to Guilfoyle told People that, “They share the same real estate agent in New York and she lives in The Beresford and he was looking in the Beresford.”

People’s source added, “I can assure you there is no love affair going on, there’s never been anything physical between those two, they are fond of each other.”