WASHINGTON — Over the past four years, judges at Washington’s federal courthouse have punished hundreds of rioters who stormed the U.S. Capitol in an unprecedented assault on the nation’s democracy. On the cusp of the next presidential election, some of those judges fear another burst of political violence.

Before recently sentencing a rioter to prison, U.S. District Judge Reggie Walton said he prays Americans accept the outcome of next month’s election. But the veteran judge expressed concern that Donald Trump and his allies are spreading the same sort of conspiracy theories that fueled the mob’s Jan. 6, 2021, riot.

“That sore loser is saying the same things he said before,” Walton said earlier this month without mentioning the Republican presidential nominee by name. “He’s riling up the troops again, so if he doesn’t get what he wants, it’s not inconceivable that we will experience that same situation again. And who knows? It could be worse.”

Walton, a nominee of President George W. Bush, is not alone. Other judges have said the political climate is ripe for another attack like the one injured more than 100 police officers at the Capitol. As Election Day nears, judges are frequently stressing the need to send a message beyond their courtrooms that political violence can’t be tolerated.

“It scares me to think about what will happen if anyone on either side is not happy with the results of the election,” Judge Jia Cobb, a nominee of President Joe Biden, said during a sentencing hearing last month for four Capitol rioters.

Judge Rudolph Contreras lamented the potential for more politically motivated violence as he sentenced a Colorado man, Jeffrey Sabol, who helped other rioters drag a police officer into the mob. Sabol later told FBI agents that a “call to battle was announced” and that he had “answered the call because he was a patriot warrior.”

“It doesn’t take much imagination to imagine a similar call coming out in the coming months, and the court would be concerned that Mr. Sabol would answer that call in the same way,” Contreras, a President Barack Obama nominee, said in March before sentencing Sabol to more than five years in prison.

Trump’s distortion of the Jan. 6 attack has been a cornerstone of his bid to reclaim the White House. The former president has denied any responsibility for the crimes of supporters who smashed windows, assaulted police officers and sent lawmakers running into hiding as they met to certify President Joe Biden’s 2020 victory.

Trump has vowed to pardon rioters, whom he calls “patriots” and “hostages,” if he wins in November. And he said he would accept the results of the upcoming election only if it’s “free and fair,” casting doubts reminiscent of his baseless claims in 2020.

Judges have repeatedly used their platform on the bench to denounce those efforts to downplay the violence on Jan. 6 and cast the rioters as political prisoners.

And some have raised concerns about what such rhetoric means for the future of the country and its democracy.

“We’re in a real difficult time in our country, and I hope we can survive it,” Walton said this month.