Federal prosecutors granted immunity to former U.S. Rep. Marjorie Margolies on the condition that she testify before a grand jury that was investigating a consultant to her 2014 campaign, court records show.

In a superseding indictment filed last month, consultant Ken Smukler was charged with facilitating illegal contributions to Margolies' campaign, causing false statements, and obstruction. Smukler had already been indicted on conspiracy and other charges involving his work for U.S. Rep. Bob Brady's 2012 campaign.

Neither Brady nor Margolies was charged, though search-warrant affidavits filed by FBI agents describe them as active participants in the criminal schemes. Smukler has pleaded not guilty.

Margolies, who like Brady is a Democrat, was willing to testify in the investigation, "but only if granted use immunity," court records show.

On March 15, Louis D. Lappen, the U.S. attorney for the Eastern District of Pennsylvania, wrote Margolies' lawyer that his office would grant immunity to Margolies on the condition that she "testify truthfully before the federal grand jury conducting this investigation."

Under the agreement, no statements Margolies gave during her testimony or information "directly or indirectly derived" from those statements could be used to prosecute her, except for perjury or similar offenses, the letter says.

Margolies and her lawyer, Marc Elias of Perkins Coie LLP in Washington, signed the agreement on March 20 — the same day prosecutors filed the superseding indictment against Smukler.

The letter was made public in a motion filed this week by Smukler to dismiss the indictment. His trial is scheduled for November.

Reached by phone Friday, Margolies declined to comment. Elias didn't respond to a request for comment.

Prosecutors typically offer this type of immunity when they want a witness' testimony but the witness asserts Fifth Amendment protection from self-incrimination, said Daniel R. Alonso, former chief of the criminal division in the U.S. Attorney's Office for the Eastern District of New York.

"This is the government's remedy to that," he said.

"As a practical matter, somebody who testifies pursuant to" an agreement like the one Margolies made "is highly, highly unlikely ever to get charged for anything remotely related to the acts about which she testified," Alonso said.

According to an FBI agent's affidavit for a warrant to search Smukler's home last year, Margolies in 2014 falsely reported a nearly $25,000 donation funneled through her personal bank account as a loan to her congressional campaign. In fact, the agent said, it was an illegal campaign contribution from Smukler.

Margolies isn't named in the indictment and prosecutors have not accused her of wrongdoing. She was elected to the House in 1992 and served one term.