ATLANTA (AP) — Former national security adviser Michael Flynn was at a downtown Atlanta courthouse Thursday to testify before a special grand jury that’s investigating whether then-President Donald Trump and others illegally tried to influence the 2020 election in Georgia.

Flynn, a retired lieutenant general, had tried to get out of appearing before the panel. But a judge in Florida last month said he must testify and an appeals court earlier this week declined to stay that order while Flynn’s appeal was pending.

Flynn could be one of the final witnesses the panel hears from as Fulton County District Attorney Fani Willis, who’s leading the investigation, has said she wants to wrap up the the special grand jury soon. The grand jurors have already questioned a number of other high-profile Trump associates, including former New York mayor and Trump attorney Rudy Giuliani and U.S. Sen. Lindsey Graham of South Carolina.

Because Flynn lives outside Georgia, Willis had to ask a judge where he lives in Florida to order him to appear. She explained in paperwork filed with the court that Flynn is a “necessary and material witness” for the investigation.

In an interview on a right-wing cable news channel in mid-December 2020, Flynn said Trump “could take military capabilities” and place them in swing states and “basically re-run an election in each of those states,” Willis wrote in a petition seeking to compel his testimony.

Flynn also met at the White House on Dec. 18, 2020, with Trump, attorney Sidney Powell and others associated with the Trump campaign for a meeting that, according to news reports, “focused on topics including invoking martial law, seizing voting machines, and appointing Powell as special counsel to investigate the 2020 election,” Willis wrote.

And he attended meetings in November 2020 at the South Carolina home of conservative attorney Lin Wood. Willis wrote that Wood said in a television interview that they met to look into possible ways to influence the election results in Georgia and elsewhere. Wood has said that he testified before the special grand jury last month.

Special grand juries in Georgia operate behind closed doors and are generally used to investigate complex cases with many witnesses. They can compel evidence and subpoena testimony from witnesses, but they cannot issue indictments. Once its investigation is complete, a special grand jury can recommend action, but it remains up to the district attorney to decide whether to then seek an indictment from a regular grand jury.