Former Vice President Mike Pence appeared Thursday before the grand jury hearing evidence about former President Donald Trump’s efforts to cling to power after he lost the 2020 election, a person briefed on the matter said, testifying in a criminal inquiry that could shape the legal and political fate of his one-time boss and possible 2024 rival.

Pence spent more than five hours behind closed doors at the U.S. District Court in Washington in an appearance that came after he was subpoenaed to testify before the grand jury earlier this year.

As the target of an intense pressure campaign in the final days of 2020 and early 2021 by Trump to convince him to play a critical role in blocking or delaying congressional certification of Joe Biden’s victory, Pence is considered a key witness in the investigation.

Pence, who is expected to decide soon about whether to challenge Trump for the 2024 Republican presidential nomination, rebuffed Trump’s demands that he use his role as president of the Senate in the certification of the Electoral College results to derail the final step in affirming Biden’s victory.

Pence’s advisers had discussions with Justice Department officials last year about providing testimony in their criminal investigation into whether Trump and a number of his allies broke federal law in trying to keep Trump in power. But the talks broke down, leading prosecutors to seek a subpoena for Pence’s testimony.

Fighting the subpoena

Both Pence and Trump tried to fight the subpoena, with the former vice president claiming it violated the “speech or debate” clause of the Constitution given his role overseeing the election results certification on Jan. 6, 2021, and Trump claiming their discussions were covered by executive privilege.

Trump’s efforts to prevent testimony based on executive privilege claims were rebuffed by the courts. Pence partially won in his effort to forestall or limit his testimony; the chief judge overseeing the grand jury ruled that he would not have to discuss matters connected to his role as president of the Senate on Jan. 6, but that he would have to testify to any potential criminality by Trump.

A federal appeals court Wednesday night rejected an emergency attempt by Trump to stop Pence’s testimony, allowing the testimony to go forward Thursday.

Trump’s effort to hold onto the presidency after his defeat at the polls — and how it led to the assault on the Capitol — is the focus of one of the two federal criminal investigations being overseen by Jack Smith, a special counsel appointed by Attorney General Merrick Garland. Smith is also managing the parallel investigation into Trump’s handling of classified documents after leaving the White House.

A district attorney in Fulton County, Ga., Fani T. Willis, has also been gathering evidence about whether Trump engaged in a conspiracy to overturn the election results in that state, and has signaled that she will announce any indictments this summer.