Federal prosecutors have moved to dismiss the government’s case against the final few dozen defendants facing rioting charges related to destructive protests in the District during President Trump’s inauguration.

The U.S. attorney’s office in the District of Columbia filed motions Friday in federal court effectively abandoning efforts to prosecute the last 39 accused rioters awaiting trial in connection with the January 2017 “DisruptJ20” protest.

“After further review, the United States, in the exercise of its discretion, has determined that these matters should be dismissed without prejudice,” U.S. Attorney Jessie K. Lieu wrote in a court filing.

Police arrested 234 people during the demonstration and charged them with rioting, but subsequent attempts to secure convictions have fallen short.

While 21 defendants pleaded guilty without going to trial, others who had their cases heard by juries have either been acquitted or had their charges dismissed.

“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 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,” prosecutors said in a statement.

“Indeed, 21 people have pled guilty to charges for their conduct that day, including one to felony offenses. In light of the results in the cases brought to trial, however, the U.S. Attorney’s Office has now moved to dismiss charges” against the remaining defendants, the statement said.

Members of the activist network declared victory on Friday.

“This is huge news,” said Dylan Petrohilos, a Washington-based activist whose charges were dropped earlier this year. “The solidarity we showed as defendants won out.”

The first trial ended with acquittals for all six defendants. After that defeat, the government dropped charges against 129 defendants, including Mr. Petrohilos, saying prosecutors would focus on the defendants against whom they had the strongest evidence.

But a second trial for four people in May ended in acquittals on most charges and a hung jury on the rest.

Mark Goldstone, a lawyer representing several of the defendants, said he was “delighted that these cases were finally dismissed.”

“They never should have been brought, and to put defendants through this continuous agony since January 2017 is a terrible miscarriage of justice and a huge waste of taxpayers’ money,” Mr. Goldstone told BuzzFeed. “Hopefully, this will deter the Government from proceeding on a group-guilt theory that an individual protester is somehow criminally responsible, and facing decades in jail for the actions of every person attending that particular protest.”

⦁ This article is based in part on wire service reports.