Former President Donald Trump must answer questions under oath in New York state’s civil investigation into his business practices, a judge ruled Thursday.

Judge Arthur Engoron ordered Trump and his two eldest children, Ivanka and Donald Trump Jr., to comply with subpoenas issued in December by New York Attorney General Letitia James.

Trump and his two children must sit for a deposition within 21 days, Engoron said.

Also Read | Donald Trump lawyers fight to block subpoena seeking his testimony

Engoron issued the ruling after a two-hour hearing with lawyers for the Trumps and James’ office.

“In the final analysis, a State Attorney General commences investigating a business entity, uncovers copious evidence of possible financial fraud, and wants to question, under oath, several of the entities’ principals, including its namesake. She has the clear right to do so.” Engoron wrote in his decision.

The ruling is almost certain to be appealed, but if upheld it could force the former president into a tough decision about whether to answer questions, or stay silent, citing his Fifth Amendment right against self incrimination.

Also Read | Capitol Riots probe: Biden orders release of Trump White House logs to Congress

James, a Democrat, said her investigation has uncovered evidence Trump’s company used “fraudulent or misleading” valuations of assets like golf courses and skyscrapers to get loans and tax benefits.

Trump’s lawyers told Engoron during the hearing that having him sit for a civil deposition now, while his company is also the subject of a parallel criminal investigation, is an improper attempt to get around a state law barring prosecutors from calling someone to testify before a criminal grand jury without giving them immunity.

“If she wants sworn testimony from my client, he’s entitled to immunity. He gets immunity for what he says, or he says nothing,” Trump’s criminal defense lawyer, Ronald Fischetti, said in the hearing, which was conducted by video conference.

Also Read | Hillary Clinton takes a dig at Donald Trump with ‘but her emails’ cap

If Trump were to testify in the civil probe, anything he says could be used against him in the criminal investigation being overseen by the Manhattan district attorney’s office.

Trump could invoke his Fifth Amendment right to remain silent in a deposition — something he’s criticized others for doing in the past. But Fischetti said if Trump did so, it could still hurt a potential criminal defense.

“If he goes in and follows my advice, which will be you cannot answer these questions without … immunity because that’s what the law provides, and take the Fifth Amendment, that’ll be on every front page in the newspaper in the world. And how can I possibly pick a jury in that case?” Fischetti said.

A lawyer for the attorney general’s office, Kevin Wallace, told the judge that it wasn’t unusual to have civil and criminal investigations proceeding at the same time.

“Mr. Trump is a high profile individual, yes. That’s unique,” Wallace said. “It’s unique that so many people are paying attention to a rather dry hearing about subpoena enforcement. But the the legal issues that we’re dealing with here are pretty standard.”

Also Read | Donald Trump clogged toilets with secret presidential documents: Report

Another Trump son, Eric Trump, and the Trump Organization’s finance chief Allen Weisselberg, have previously sat for depositions in the civil investigation — and invoked their Fifth Amendment rights hundreds of times when they were questioned by investigators in 2020.

Another lawyer for Donald Trump, Alina Habba, accused James of trying to use the civil investigation to gather evidence for the criminal probe.

She said the civil investigation should be stayed until the criminal matter is over, claiming James’ office is putting the Trumps “in a position where they either disclose evidence in a civil investigation or they have to invoke the constitutional right not to testify, thereby triggering an adverse inference in the civil action.”

“How is that fair, your Honor? We have to stop one,” she said.

Alan Futerfas, a lawyer for Ivanka and Donald Trump Jr., both of whom have been executives in their family’s Trump Organization, said during the court hearing that so far he had no reason to believe either are targets of the district attorney’s criminal investigation.

In a statement Tuesday, Trump railed against what he called a “sham investigation of a great company that has done a spectacular job for New York and beyond” and a racially motivated “continuation of a Witch Hunt the likes of which has never been seen in this Country before.”

Habba argued at Thursday’s hearing that James’ investigation is “selective prosecution” and that the attorney general is “engaging in viewpoint discrimination” motivated by her political ambitions and disdain for the Republican former president, evinced by comments she made over the years about going after Trump.

“We have an extraordinary rare case where we can prove selective prosecution because she’s put her words out there so much and taken every opportunity to voice her vendetta against Donald Trump and his family to take him down,” Habba said.

Also Read | Donald Trump’s GOP: Party further tightens tie to former president

Wallace noted the state attorney general’s office was investigating Trump-related matters as far back as 2013, including probes into his charitable foundation and a Trump University real estate training program that started long before James was elected.

In a court filing this week, James included a letter from Trump’s longtime accounting firm advising him to no longer rely on years of financial statements it prepared based on his company’s valuations, given the questions about their accuracy.

Last summer, spurred by evidence uncovered in James’ civil investigation, the Manhattan district attorney’s office charged Weisselberg and the Trump Organization with tax fraud, alleging he collected more than $1.7 million in off-the-books compensation. Weisselberg and the company have pleaded not guilty.

Engoron previously sided with James on other matters relating to the probe, including making Eric Trump testify after his lawyers abruptly canceled a scheduled deposition.