Maria Butina, leader of a pro-gun organization in Russia, speaks in 2013 to a crowd during a rally in support of legalizing the possession of handguns in Moscow. (AP)

U.S. prosecutors have acknowledged they misunderstood text messages they used to claim in court that a Russian woman traded sex for access and should be jailed pending trial on charges she was a foreign agent attempting to infiltrate the National Rifle Association and other American conservative groups.

The concession came in a late-night court filing Friday in which prosecutors said Maria Butina, 29, should stay in custody as a flight risk but wrote “the government’s understanding of this particular text conversation was mistaken.”

Prosecutors said she has deep ties to Russia and few connections to the United States. They also assert other materials and communications investigators uncovered throw doubt on Butina’s claim that she should be freed on bond because she has U.S. ties in her longtime relationship with Paul Erickson, a South Dakota-based Republican consultant she met in Moscow in 2013 and with whom she has been romantically linked.

“The government has enormous power to destroy lives and reputations through the criminal process,” Butina’s defense attorney, Robert N. Driscoll, said in a statement about the new court filing. “This is an unfortunate example of the misuse of that power. I’m glad the false allegation has been acknowledged, but it’s a hard bell to unring.”

Butina has pleaded not guilty after being indicted July 17 on charges of conspiracy to act and failing to register as an agent of a foreign government. Her defense said she was merely networking to develop relationships with Americans.

Butina’s attorneys and prosecutors with the U.S. attorney’s office of the District and Justice Department’s national security division are set to argue over bail and whether to impose a gag order in the case in a Monday afternoon hearing before U.S. District Judge Tanya S. Chutkan of Washington.

Driscoll argued in a filing last month that the allegation was a “sexist smear” that created the false impression Butina used sex as a spy tool. His filing said the allegation had been featured prominently in news coverage around the world, including on television in Siberia, where Butina’s parents live.

Prosecutors had argued that Butina had once offered sex in exchange “for a position with a special interest organization.”

Driscoll said the allegation was based on an erroneous interpretation of a playful text exchange between Butina and a married, longtime friend who does public relations work for a Russian gun rights group Butina founded.

In the 2015 exchange, the friend texted Butina after doing her a favor by taking her car to have its insurance renewed.

“I don’t know what you owe me for this insurance[.] They put me through the wringer,” he wrote to her in Russian.

“Sex,” she responded, adding: “Thank you so much. I have nothing else at all. Not a nickel to my name.”

Later in the texting, the man replied to Butina: “Think of something!! . . . Sex with you does not interest me.”

Prosecutors said their mistake should not undermine the gravity of the government’s overall case.

The case is not part of the special counsel’s investigation into Russian interference in the 2016 election, but experts said it demonstrates the scale and scope of Russian efforts to influence U.S. politics.

Butina is accused of trying to cultivate “back-channel” relationships with the Republican Party’s leading presidential candidates and develop close ties to the NRA to provide Russian officials “with the best access to and influence over” the party.

Butina allegedly was assisted by Erickson, who helped introduce her to influential political figures and who sought to organize a meeting between then-candidate Donald Trump and Alexander Torshin, Butina’s colleague and a Russian central banker, at a May 2016 NRA convention.

Butina spent two years at American University in the global security program at the School of International Service and received a master’s degree in May.

In arguing Friday that Butina should continue to be detained, prosecutors provided additional evidence that Torshin coordinated Butina’s activities, writing that at his direction, she drafted language to persuade the Russian foreign ministry to let him attend the NRA meeting as a “unique opportunity” to network with Trump and his entourage.

The campaign declined a request by Erickson to have Trump meet “Putin’s emissary,” but Torshin and Butina briefly interacted with Donald Trump Jr. at a dinner.

Prosecutors also cited Moscow’s vehement protests of her case — including six consular visits to Butina in jail, four diplomatic notes, two personal complaints by Foreign Minister Sergey Lavrov to Secretary of State Mike Pompeo and the official Kremlin Twitter account placing Butina’s face as its avatar — in telling the judge they “confirmed her relationship with, and value to, her own government.”

“The significance of defendant Butina to the government of the Russian Federation is evident in light of the Russian government’s actions since her arrest,” prosecutors wrote, adding “so too, does it underscore her risk of flight.”