A federal judge has ruled that Sen. Lindsey Graham, R-S.C., will have to testify before a special grand jury that is looking into whether former President Donald Trump and others violated any laws during Trump's efforts to reverse the state's outcome in the 2020 presidential election.

The Republican senator from South Carolina had fought a subpoena from Fulton County prosecutors, with his attorneys claiming that as a senator he has immunity regarding being questioned over legislative acts.

In a Monday ruling, U.S. District Judge Leigh Martin May said there are "considerable areas of potential grand jury inquiry" that fall outside that protection, and that senators do not enjoy sovereign immunity from being called by state prosecutors.

The grand jury first started hearing witnesses in June, including Georgia Secretary of State Brad Raffensperger. Graham is one of seven associates or advisers of Trump Fultcon County District Attorney Fani Willis has been trying to compel to testify.

SEN. LINDSEY GRAHAM FIGHTS GEORGIA SUBPOENA OVER 2020 ELECTION CALLS IN FEDERAL COURT

Lindsey Graham

Sen. Lindsey Graham speaks with reporters about aid to Ukraine, on Capitol Hill, March 10, 2022.  (AP Photo/Alex Brandon, File)

The DA's office argued that Graham's testimony could provide key information about whether there were coordinated efforts to affect Georgia's election results. Willis said in a court filing that Graham is a "necessary and material witness."

Specifically, Willis said she wanted to know more about two phone calls Graham had with Raffensperger and his staff in the days and weeks after the election.

RUDY GIULIANI, LINDSEY GRAHAM PETITIONED BY GEORGIA GRAND JURY IN TRUMP ELECTION CASE

"During the telephone calls, the Witness questioned Secretary Raffensperger and his staff about reexamining certain absentee ballots cast in Georgia in order to explore the possibility of more favorable outcome for former President Donald Trump," Willis said, adding that Graham "made reference to allegations of widespread voter fraud in the November 2020 election in Georgia, consistent with public statements made by known affiliates of the Trump Campaign."

Smiling Donald Trump and Lindsey Graham

President Donald Trump smiles as he stands alongside Sen. Lindsey Graham during a Keep America Great campaign rally in North Charleston, South Carolina, Feb. 28, 2020. (Saul Loeb/AFP via Getty Images)

In a statement, Graham's office insisted that the Speech or Debate Clause of the Constitution protects Graham from having to answer prosecutors' questions, and said he will appeal the decision.

"Here, Senator Graham was doing his due diligence before the Electoral Count Act certification vote — where he voted to certify the election," Graham's office said. "Although the district court acknowledged that Speech or Debate may protect some of Senator Graham’s activities, she nevertheless ignored the constitutional text and binding Supreme Court precedent, so Senator Graham plans to appeal to the 11th Circuit."

CLICK HERE TO GET THE FOX NEWS APP

Trump himself came under fire for a phone call he had with Raffensperger for saying that he wanted the secretary to "find" 12,000 votes so he could win the state. The full context of the request was that Trump insisted that there "at least a couple of hundred thousand of forged signatures," and that he just needed the state to find enough to make up for the 11,779 votes by which he trailed Joe Biden.

An investigation of the hand recount in Fulton County found that while there were some mistakes in the process, it was not enough to affect the outcome of the election.

The  Associated Press contributed to this report.