A federal judge in New Jersey delivered Nxivm sex cult leader Keith Raniere an unwelcome birthday gift on Monday when he ordered the group to cough up more than $1 million it owes to an investigation firm previously hired to fend off a civil lawsuit brought in the state.

US District Judge for the District of New Jersey Katharine Hayden ruled in favor of the New York-based firm Interfor on Monday — the 59th birthday of Raniere, who was found guilty back in June on all charges, including sex-trafficking, for running the upstate sex cult.

The judge ordered Nxivm to dole out a total of $1,369,157. 51 in back pay to Interfor, which the sect recruited back in 2004 to investigate cult expert Rick Ross.

Nxivm sued Ross, the founder of the Cult Education Institute, in 2003 and hired Interfor to probe “the basis for Rick Ross’ anti-Nxivm campaigning and related activities” that Nxivm described as “vicious false and fraudulent misrepresentations,” according to the court documents.

When Ross counter-sued and named Interfor as a defendant, Nxivm paid more than $160,000 to a law firm it retained to represent Interfor, per an indemnity agreement.

But a Nxivm lawyer alerted that law firm in 2007 that it would “not continue to reimburse or indemnify Interfor for expenses or liabilities incurred in connection with this matter,” because the company “went beyond what the parties intended would be done, and beyond what Nxivm authorized Interfor to do,” the court papers say.

Nxivm based its decision on the belief that Interfor’s conduct in connection with its investigation “went beyond what the parties intended would be done, and beyond what Nxivm authorized Interfor to do.”

The group claimed that it had “no further obligation to indemnify Interfor for expenses or liabilities in this matter.”

Raniere is currently awaiting sentencing in his sex-trafficking case. He faces life in prison.

The now-disbanded Nxivm has until Oct. 15 to file opposition to the ruling.

Additional reporting by Israel Salas-Rodriguez