WASHINGTON >> A federal judge has ruled that former Vice President Mike Pence will have to testify before a grand jury in the Justice Department’s investigation into efforts by former President Donald Trump and his allies to overturn the results of the 2020 election.

That’s according to two people familiar with the decision, who spoke Tuesday on condition of anonymity because the ruling remains under seal.

The ruling says Pence will not have to answer questions about his actions on Jan. 6, 2021, when a mob of Trump’s supporters stormed the Capitol building as Republican Pence was presiding over a joint session of Congress to certify Democrat Joe Biden’s victory. However, he would have to testify about any potential illegal acts committed by the former president, one of the people said.

Pence and his attorneys had cited constitutional grounds in challenging a grand jury subpoena issued weeks ago. They argued that, because he was serving in his capacity as president of the Senate that day, he was protected from being forced to testify under the Constitution’s “speech or debate” clause, which is intended to protect members of Congress from questioning about official legislative acts.

Trump’s lawyers had also objected to Pence complying, citing executive privilege.

A Trump spokesman criticized the decision in a statement, accusing the Justice Department of “continuously stepping far outside the standard norms in attempting to destroy the long accepted, long held, constitutionally based standards of attorney-client privilege and executive privilege.”

Pence’s team is evaluating whether it will appeal.

The sealed ruling from U.S. District Judge James “Jeb” Boasberg sets up the unprecedented scenario of a former vice president being compelled to give potentially damaging testimony against the president he once served. And it comes as Pence has been inching closer to announcing a run for the 2024 Republican presidential nomination.

In addition to the Justice Department probes, Trump is under investigation in Georgia and also in New York, where a grand jury has been hearing testimony about alleged hush money paid to women on Trump’s behalf during the 2016 campaign.