Three key witnesses to Hillary Clinton’s use of a private email server were given immunity from prosecution in exchange for their cooperation with the FBI’s investigation, a top U.S. congressman said on Friday. The revelation is certain to fuel Republican anger over the FBI’s handling of the Clinton investigation just days before she and GOP rival Donald Trump will face off at the first presidential debate.

Those who received the deals were Clinton’s former State Department chief of staff and her attorney, Cheryl Mills; Clinton aide and lawyer Heather Samuelson; and John Bentel, who ran the State Department's information resources management office when Clinton served as secretary.

Potential witnesses are only given immunity when investigators have concluded they cannot obtain the information they need from any other sources. That the three individuals were given deals indicates that the FBI felt their knowledge was vital to its investigation.

The immunity deals, which were first reported by the Associated Press and independently corroborated by The Daily Beast, shed new light on the FBI’s investigation into Clinton’s server.

Bentel, who was aware that Clinton was using a private email server while she was secretary of state, was given immunity from prosecution for the improper transmission or storage of classified materials on unclassified servers, an individual with knowledge of the agreement told The Daily Beast.

The FBI found that some of the emails on Clinton’s server contained highly-classified information. In 2010, when two State Department employees asked Bentel why Clinton was using a private server, he told them that the matter had been reviewed by the department’s lawyers and that it “was not to be discussed any further,” according to the State Department inspector general.

Mills and Samuelson were given immunity in exchange for handing over their laptop computers to the FBI, with an agreement that they would not be prosecuted for any information obtained from those laptops, according to a statement from Democratic members of the House Oversight and Government Reform Committee.

Brian Fallon, a spokesman for the Clinton campaign, dismissed the information as "House Republicans are trying to make something out of nothing" and a political ploy three days before the presidential debate.

"As the case file makes clear, these aides were considered nothing more than witnesses and they cooperated in full with the Justice Department inquiry," Fallon said. "This kind of agreement is not at all unusual in an inquiry such as this, and it came after these aides had already given full interviews to the investigators. When the case was closed in July, Director Comey himself said these aides had acted in good faith."

He added, "Congressman Chaffetz continues to abuse his office by wasting taxpayer dollars to try to second-guess the FBI in what amounts to a desperate attempt to boost Donald Trump's chances against Hillary Clinton."

Mills and Samuelson played key roles in the handling of Clinton’s emails. The two attorneys worked with Clinton’s longtime lawyer, David Kendall, to decide which of Clinton’s emails to turn over to the State Department after she left office and which ones she would retain because they were determined to involved personnel matters.

Both lawyers had copies of Clinton’s emails on their laptops, but they removed those copies in late 2014 or early 2015, the FBI found, months before the existence of the private server became known publicly.

The decision to give Bentel, Samuelson, and Mills immunity drew swift condemnation from Rep. Jason Chaffetz, the oversight committee chairman, who has objected to the FBI’s decision not to recommend prosecuting Clinton or her aides.

"This is beyond explanation,” Chaffetz said in a statement. “The FBI was handing out immunity agreements like candy. I've lost confidence in this investigation and I question the genuine effort in which it was carried out. Immunity deals should not be a requirement for cooperating with the FBI."

Bentel, Mills, and Samuelson have also been the subject of intense interest by a conservative watchdog group, Judicial Watch, which has sued for more information about how Clinton set up the server and why she opted not to use an official .gov email account.

The group deposed Mills in May and will take a deposition from Bentel in October.

Bentel, in late 2010, told two State Department employees not to discuss Clinton’s email system after they raised questions with him about why she was using a private account. The department’s inspector general found that the employees “discussed their concerns about Secretary Clinton’s use of a personal email account” with Bentel in late 2010, five years before the existence of the server became known publicly.

“In one meeting, one staff member raised concerns that information sent and received on Secretary Clinton’s account could contain Federal records that needed to be preserved in order to satisfy Federal recordkeeping requirements,” the IG found. “According to the staff member, the Director [Bentel] stated that the Secretary’s personal system had been reviewed and approved by Department legal staff and that the matter was not to be discussed any further.”

In fact, Clinton didn’t seek approval for the system from the department’s lawyers, and had she asked, the approval wouldn’t have been granted, the IG found.

Republican lawmakers have publicly second-guessed Director James Comey’s decision not to recommend criminal charges. Chaffetz has launched his own inquiry into whether Clinton committed perjury when she testified about her email system before the House committee investigating the Benghazi, Libya, terrorist attacks in 2012. Clinton has said she never sent or received classified information over her private email, a claim that has been disproved by the FBI’s investigation.

On Thursday, Justice Department lawyers also showed Chaffetz and his committee members a copy of another immunity agreement given to Bryan Pagliano, the former Clinton IT staffer who set up her server in her New York home and maintained it for her while he worked at the State Department. His deal was previously known.

On Thursday, Chaffetz’s committee approved a contempt finding against Bryan Pagliano, the technology specialist who set up the server in Clinton’s New York home and maintained it for her while he worked at the State Department. Pagliano was also given immunity for cooperating with the FBI. Chaffetz’s committee had subpoenaed him to testify about the emails system but he refused to show up.

Jackie Kucinich contributed reporting