Activists burn posters during a DeploraBall protest in the street outside the National Press Club in Washington on Jan. 19. (Paul J. Richards/AFP/Getty Images)

In the weeks leading up to President Trump’s inauguration, a small group of activists threatening to disrupt the event tried to keep the details secret. D.C. police detectives worked hard to learn the plans and head the protesters off.

What neither authorities nor the protesters apparently realized was that conservative activist James O’Keefe’s Project Veritas had already infiltrated key meetings of groups of suspected agitators.

A D.C. police spokesman has confirmed that a secret video recording made Dec. 18 by one of O’Keefe’s operatives led to the arrest of one man and foiled an alleged plot to spread acid at the DeploraBall for Trump supporters at the National Press Club. It was not clear whether the alleged plotters ever obtained the acid.

Law enforcement authorities said they think that the successful penetration of DisruptJ20, an umbrella organization for a number of groups that police said sought to wreak havoc at the inauguration, forced it to abandon plans to try to shut down Metro trains and block entrances into the District, according to two law enforcement officials with knowledge of the investigation.

To O’Keefe, who for years has targeted liberal groups with undercover stings, the arrest validates his group and its controversial methods. Project Veritas has been criticized for selectively editing videos, but its work led to the resignation of Democratic political operatives caught discussing ways to disrupt Trump rallies. In 2009, O’Keefe’s group infiltrated Acorn, a community-based housing and social services agency, and recorded two members offering improper advice. Congress later defunded ACORN, and it dissolved.

“I’ve spent years trying to fight the mainstream media that doesn’t view me as a journalist,” O’Keefe said in an interview. “This is the first time that a video we shot has led to an arrest. It legitimizes what we’re doing. It’s a new era for us.”

Lacy MacAuley, a DisruptJ20 spokeswoman, said on Wednesday that the group never actually intended to use a stink-bomb at the DeploraBall. The discussions caught on video, she said, reflected a false story the group created after members became convinced they had been infiltrated.

MacAuley said the group did not know the infiltrator’s intentions. She said members made up the plot to distract that person from their real plans at the ball, which she said consisted mostly of street protests. A police arrest affidavit says DisruptJ20 provided a similar account to law enforcement.

D.C. police said they arrested Scott R. Charney, 34, of Northwest Washington on Thursday, the day before the inauguration and hours before the DeploraBall in downtown Washington. Charney lists himself on LinkedIn as a sales associate as well as a foreign-policy analyst who has worked for several think tanks.

Charney was charged with conspiracy to commit assault, a misdemeanor, in connection with the alleged planned acid attack. He was freed from jail with a court hearing scheduled Feb. 3. Police said they are searching for two others who were also at the Dec. 18 recorded meeting, which took place at a pizza restaurant in upper Northwest Washington.

Charney could not be reached for comment. His attorney, Elise Haldane, said she was unaware of the Project Veritas recordings, which are posted on the group’s Internet site, until informed by a reporter. After viewing the videos, she declined to comment. She would not confirm whether Charney was one of the people who appears or is heard in the video.

The first signs of trouble during the inauguration festivities occurred outside the DeploraBall. Protesters confronted Trump supporters, one of whom was hit in the head with a rock. One small group wearing black masks and hoods set a fire in the street, and police used pepper spray to control the crowd.

The next day, thousands of demonstrators took to the streets, with some blocking entry points to the Mall and the parade route as Trump was sworn in as president. Interim police chief Peter Newsham said most of the demonstrators were peaceful. But police said a group turned violent, breaking car and store windows, overturning news boxes and throwing rocks and bricks at riot police in a four-block area of downtown. Authorities arrested 230 people.

The violence was blamed on members of the “black bloc,” a more militant faction associated with DisruptJ20, which had advertised that its goal was to disrupt the inauguration through both passive resistance and more aggressive measures.

The group said some demonstrators — such as those from anti-capitalist groups and the D.C. Anti-Fascist Coalition — had pre­selected members for arrest.

The video in which the alleged planned acid attack was discussed was recorded at Comet Ping Pong on Connecticut Avenue, the same pizza shop a gunman had entered weeks earlier to investigate fake news claims of an underground child-porn ring involving Democratic officials.

It was the night of Dec. 18, in a booth in the crowded restaurant. A football game played on the big screen. At least one of the four people at the table had a mug of beer. They talked in normal, sometimes hushed voices. On the video, Project Veritas identifies Charney using a different last name; police said in the arrest affidavit that it is an alias.

One person at the table warned that “we do not recognize the city government. . . . If you try to close us down, we will look for your house, and we will burn it. We will physically fight the police if they try to steal one of our places. We will go to war, and you will lose.”

Talk then turned to the possible use of butyric acid, which can damage skin and eyes. “I was thinking of things that ruin, that would ruin their evening, ruin their outfits, or otherwise make it impossible to continue with their plans,” one man said. “Make sure they get nothing accomplished.”

The video shows the group discussing getting the acid into a building’s ventilation system and, failing that, spreading it on the floor. Backup plans included finding a way to activate all the sprinklers simultaneously. Police said in the affidavit that one member had tickets to the ball.

The same man described butyric acid as “very efficient” and “very smelly” and said that “a little bit goes a long way. . . . That stuff is nasty enough that it will seep, it will spread.”

A spokesman for O’Keefe would not allow The Washington Post to review the unedited version of the video. He said only the beginning and end were trimmed.

A second video of other purported activists, also secretly recorded in the District and posted online by Project Veritas, includes discussions of shutting down major roads leading into the city, chaining Metro cars together to bring the Metro system to a halt and randomly “punching Nazis” encountered on Inauguration Day.

This report has been updated to include comments from Lacy MacAuley, a DisruptJ20 spokeswoman.