Federal prosecutors on Friday dismissed rioting charges against all remaining defendants arrested after destructive Inauguration Day protests in the nation’s capital, bringing to a close a controversial case that led to allegations of government overreach.

Prosecutors began filing paperwork Friday afternoon to formally drop the cases against 39 people who had been awaiting trial.

The vandalism of downtown businesses on the day President Trump was sworn in stretched more than 16 blocks as part of a disturbance called DisruptJ20. Members of a large group of protesters set small fires and used bricks and crowbars to smash storefronts. Prosecutors had said six police officers were injured.

In all, 234 people were arrested and charged with rioting. Of them, 21 defendants pleaded guilty before trial. But prosecutors had been unable to secure convictions at trial against others in the group.

Defense attorneys have long contended that prosecutors went too far in pursuing cases against more than 200 people. They argued that their clients were not rioting, but were swept up in the arrests while peacefully protesting.

Lacy MacAuley, one of the organizers of the DisruptJ20 Inauguration Day protests, said she celebrated the decision to end the prosecutions. She said the defendants have “suffered” more than a year of angst associated with the arrests, forcing many of them to put their lives on hold as they waited for outcomes in the criminal cases.

“How do you plan for your job and family and personal life when you are facing decades in prison?” MacAuley said.

After the first six defendants to go to trial were acquitted late last year, prosecutors dropped charges against more than 150 others, saying they were unable to prove those people planned or participated in protests with the aim of causing damage. Charges against several additional defendants were dropped after D.C. Superior Court Judge Robert E. Morin found that the U.S. Attorney’s Office failed to turn over some video evidence to the defense.

At a second trial involving another handful of defendants, jurors either acquitted them or were unable to reach a unanimous verdict.

Jurors in the two cases that went to trial said afterward that the government couldn’t prove which of the people in the chaotic crowd were the vandals. Over time, prosecutors dismissed more of the cases, and others had been set for trial.

Jessie K. Liu, U.S. attorney for the District, declined to comment on the decision. In a statement from her office, prosecutors noted that 21 of the people arrested have admitted guilt but said “in light of the results in the cases brought to trial” they had made the decision to halt the cases.

“The U.S. Attorney’s Office for the District of Columbia believes that the evidence shows that a riot occurred on January 20, 2017, during which more than $100,000 in damage was caused to numerous public and private properties,” the statement read. “The destruction that occurred during these criminal acts was in sharp contrast to the peaceful demonstrations and gatherings that took place over the Inauguration weekend in the District of Columbia, and created a danger for all who were nearby.”

Of the 21 who pleaded guilty, only one defendant served jail time. Last July, Dane Powell, of Tampa, was sentenced to four months in prison.

In a Saturday statement, D.C. Police Chief Peter Newsham said “in the American criminal justice system, sometimes the bad guys win. That’s what happened in this case.”

Newsham said police would “adjust our tactics accordingly to insure that anyone who comes to Washington DC with the intent of destroying property and/or injuring people is held accountable for their actions.” He did not immediately elaborate.

Prosecutors had contended that the rioters blended in with protesters by using “black-bloc” tactics, wearing dark clothes and hiding their faces with masks and goggles so it would be harder for authorities to identify them while they participated in violence.

“They overreached in terms of their legal theory,” said Mark Goldstone, a D.C. defense attorney who represented two defendants, both of whose cases were dismissed. “That a person is responsible criminally for any destruction and violence inccurred by someone in the same vicinity because of the clothes they wore — and because of that, a person is facing 70 years in jail because of someone else’s actions — that is absolutely preposterous.”

“It was a waste of time and a waste of taxpayers’ resources,” Goldstone said. “They spent way more in prosecution than the financial damages that were caused.”

To prove their cases, detectives and prosecutors relied on videos from police officers’ body cameras, cellphones and security cameras in hopes of linking the defendants to the riots.

But jurors later said the images were not clear enough to know for sure.

During the cases, prosecutors also were criticized over the handling of key evidence, undercover video supplied to them by Project Veritas, a conservative activist group that uses secret recordings to target the mainstream news media and left-leaning groups.

Prosecutors said Veritas representatives secretly attended and recorded a planning meeting leading up to the riots.

Two judges, including Morin, determined the lead prosecutor on the cases, Jennifer Kerkhoff, failed to either supply all of the Veritas video to defense attorneys before trial or edited the videos and failed to disclose all of the edits to attorneys. Kerkhoff has filed a motion with Morin asking the judge to reconsider his findings against her.

Glenn Kirschner, a former assistant U.S. attorney in the District, disagreed that prosecutors overreached but acknowledged that his former colleagues may have decided “too late” that they had “insurmountable challenges” in proving guilt beyond a reasonable doubt.

Kirschner said top officials in the office would have signed off on the initial decision to indict.

“This case was vetted up and down,” Kirschner said. “We can’t be too timid to bring cases. It just means we see the evidence differently than the jury sees it.”

Peter Jamison and Peter Hermann contributed to this report.