A federal judge has ordered former Vice President Mike Pence to testify before a grand jury about conversations he had with former President Donald Trump in which they allegedly talked about how to overturn the 2020 election, according to two sources familiar with the case.

The sealed order from Chief Judge James Boasberg is another legal setback for Trump and his efforts to block an ongoing special counsel Jack Smith's investigation into events leading up to the January 6, 2021 riots in the U.S. Capitol.

Pence was subpoenaed last month by the Justice Department special counsel as part of the probe into the Jan. 6 riot. Pence's team filed a motion to block that subpoena, claiming that as vice president, his conversations with Trump and top White House aides were protected by executive privilege claims.

TRUMP CALLS PENCE A ‘VERY HONORABLE MAN’ AFTER SPECIAL COUNSEL JACK SMITH SUBPOENA

Pence at FIU

Former Vice President Mike Pence answers questions from the press during a visit to Florida International University (FIU) in Miami, Florida, as part of the book tour for his New York Times bestselling book, So Help Me God, on Friday, Jan. 27, 2023.  ((Photo by Scott McIntyre/For The Washington Post via Getty Images))

But Judge Boasberg on Tuesday rejected those arguments after meeting with lawyers from both sides in a closed court hearing last week in Washington.

Sources told Fox News that Boasberg ruled separately that Pence could refuse to answer certain questions to the grand jury about his role as President of the Senate, during the January 6 election certification process in the U.S. Capitol. That effort was interrupted for a time by violent encounters with protesters in the building.

Pence had claimed that the Constitution’s "speech or debate" clause shields him from questions about official legislative actions.

FORMER VICE PRESIDENT MIKE PENCE FILES MOTION TO BLOCK JAN. 6 SUBPOENA: REPORTS

Former Vice President Mike Pence

Former Vice President Mike Pence speaks during an event to promote his new book at the conservative Heritage Foundation think tank on October 19, 2022. (Chip Somodevilla/Getty Images)

Pence had earlier indicated he was prepared to appeal any requirement he testify, all the way to the U.S. Supreme Court if necessary.

PENCE RIPS 'TWO-TIERED JUSTICE SYSTEM' AS HE FIGHTS BIDEN DOJ SUBPOENA

Former Vice President Mike Pence points as he arrives to speak at a campus lecture hosted by Young Americans for Freedom at the University of Virginia in Charlottesville, Virginia, on April 12, 2022. (Photo by RYAN M. KELLY/AFP via Getty Images)

Former Vice President Mike Pence points as he arrives to speak at a campus lecture hosted by Young Americans for Freedom at the University of Virginia in Charlottesville, Virginia, on April 12, 2022. (RYAN M. KELLY/AFP via Getty Images)

CLICK HERE TO GET THE FOX NEWS APP

There was no immediate reaction to the judge’s ruling from Pence, Trump, or the Justice Department.