A group calling itself The Militia outside the Unite the Right rally in Charlottesville Aug. 12. (Evelyn Hockstein/For The Washington Post)

Charlottesville residents, business leaders and elected officials went to court Thursday to try to prevent a repeat of the violence at a white-nationalist rally this summer that rocked the university town.

The legal response from the local community, including from individuals injured during the confrontations, comes as officials from Boston to Berkeley are looking for ways to avoid similar clashes at political protests.

Two filings — one in federal court, and the other in state court — target "Unite the Right" rally leaders and organizers, including white nationalists Richard Spencer, Jason Kessler and Matthew Heimbach.

The federal lawsuit, brought by residents injured in August, seeks monetary damages and a ban on similar gatherings. The complaint cites federal laws enacted during Reconstruction to counter intimidation of blacks in the South and more recent cases targeting antiabortion activists.

The other suit, joined by the Charlottesville City Council, fixes on the heavily armed, camo-clad private militias at the rally using a rarely invoked provision of Virginia's constitution that attorneys say bans military organizations other than those controlled by the state government. That complaint seeks to avoid another "invasion of roving paramilitary bands and unaccountable vigilante peacekeepers."

"Charlottesville has been besieged repeatedly by these groups, and key organizers and leaders of the Unite the Right rally have pledged to return to Charlottesville as often as possible," according to the lawsuit filed by Georgetown Law School's Institute for Constitutional Advocacy and Protection with support from city officials.

Charlottesville exploded into the nation's consciousness Aug. 11 and 12, when hundreds of white supremacists, white nationalists and neo-Nazis from across the country gathered to protest the planned removal of a Confederate statue from a city park.

At a nighttime torchlight rally, marchers chanted "Jews will not replace us!" and "Blood and soil!" before engaging in a violent confrontation with a small group of counterprotesters. The next day — a Saturday — the planned rally, which had a permit, was canceled by law enforcement as nationalists and counterprotesters brawled on Charlottesville's downtown streets while police stood back.

In midafternoon, James Alex Fields Jr., a 20-year-old reported Nazi sympathizer, allegedly drove his car into a crowd of pedestrians. Heather Heyer, 32, of Charlottesville was killed, and 19 others were injured.

The plaintiffs in the federal lawsuit include University of Virginia students, Charlottesville residents and religious leaders who say they were subjected to tear gas, physical and verbal assaults and, in one case, were targeted online by white supremacists who posted their photos on a racist website.

[Charlottesville lawsuit seeks restrictions on white nationalist groups]

The Ku Klux Klan, Vanguard America, the Nationalist Front and the League of the South, all of which support white nationalist or supremacist aims and took part in the rally, are among the three dozen individuals and organizations named in the 98-page federal complaint.

"The violence in Charlottesville was no accident," the lawsuit reads. "In countless posts on their own websites and social media, defendants and their co-conspirators promised that there would be violence in Charlottesville and violence there was."

Plaintiffs Marissa Blair, 28, and her fiance, Marcus Martin, 27, were standing among counterprotesters on Fourth Street in Charlottesville when the Dodge Challenger plowed into the crowd. Martin pushed Blair out of the way, but he was struck and his leg and ankle were broken.

"I went to look for him, and all I found was his bloody baseball cap. I thought he was dead," Blair said in an interview Wednesday.

"Freedom of speech, we get it," Blair said. "But not when you're doing it to terrorize people. There has to be a stop to it. We want to let Charlottesville live in peace."

The federal case was filed by New York attorney Roberta A. Kaplan, who represented Edith Windsor in the landmark Supreme Court case that ordered the federal recognition of same-sex marriage, and Washington attorney Karen Dunn, a former federal prosecutor. The lawsuit is funded by Integrity First for America, a new nonprofit group aimed primarily at bringing legal challenges to President Trump's businesses.

The legal approach in the federal complaint was inspired in part by an Oregon case from the late 1990s in which a group of doctors successfully sued antiabortion activists over a website that targeted doctors who perform abortions.

Spencer declined to comment on the lawsuit. Other defendants, including Kessler and Heimbach, did not respond to requests for comment.

Last Saturday, Spencer returned to the Charlottesville park, where a statue of Gen. Robert E. Lee has been covered by the city in a tarp, and held a smaller torchlight rally with a few dozen followers who chanted: "We will be back!"

That evening, Charlottesville Mayor Mike Signer tweeted: "Another despicable visit by neo-Nazi cowards. You're not welcome here! Go home! Meantime we're looking at all our legal options. Stay tuned."

Spencer told The Washington Post the next day that the mayor has "no authority to prevent lawful protests like what we did last night. . . . He currently thinks the city of Charlottesville is a sovereign nation or something."

[Richard Spencer vows to keep coming back to Charlottesville? Can the city legally stop him?]

At an early morning meeting Thursday, Charlottesville City Council voted 4 to 0 — with one member absent — to sign on to the second lawsuit, filed minutes after the vote on the state suit.

The complaint lists 22 white-nationalist organizations, leaders and private militia groups as defendants, saying these "military forces transformed an idyllic college town into a virtual combat zone."

Many wore matching uniforms and used command structures to coordinate actions, according to the lawsuit that also details planning and paramilitary tactics it says were discussed via social media. The groups of men dressed in camouflage and carrying semiautomatic rifles at the August rally confused even Virginia's public safety secretary, Brian Moran, who first assumed some were soldiers in the state's National Guard.

[How Charlottesville lost control amid deadly protest]

The lawsuit tries to preempt likely arguments from defendants, saying it does not seek to restrict individual rights to gun ownership or free-speech rights to assemble and express political views.

"Our complaint shows that there are legal tools available to ensure that the streets do not become battlefields for those who organize and engage in paramilitary activity," said the Georgetown institute's senior litigator, Mary B. McCord, a longtime federal prosecutor who was most recently head of the Justice Department's National Security Division.

Under Virginia law dating to 1776, the state constitution specifies that "in all cases the military should be under strict subordination to, and governed by, the civil power." That means, according to the court filing, that the "government alone retains a monopoly on the organized use of force."

"Whatever their stated intentions, these groups terrified local residents" and created confusion about who was in charge, the complaint asserts.

Among the defendants in the case invoking Virginia's constitution is Christian Yingling, a leader of the Pennsylvania Light Foot Militia, who has said that he and his troops "convoyed in" to Charlottesville to defend free speech and maintain civil order.

Yingling declined to comment Thursday, saying he was reviewing the lawsuit.

[Militiamen came to Charlottesville as neutral First Amendment protectors, commander says]

Laws similar to Virginia's have been used throughout history in cases filed in Texas and North Carolina to shut down paramilitary activities by the Ku Klux Klan. The statutes on the books in most states make clear that only the government can control military organizations in a state.

After the August rally, University of Virginia historian Philip Zelikow thought of a Texas case he'd worked on in the 1980s that relied on state law banning "military companies" not authorized by the governor. In that case, a judge stopped the Ku Klux Klan from training paramilitary groups to harass Vietnamese American fishermen on the Texas Gulf Coast.

Zelikow called the Charlottesville case an important reminder of laws on the books for decades "that are meant to keep our political protests and confrontations free from paramilitary intimidation and companies of men with guns."

An article that Zelikow had written about the Texas case on the Lawfare site caught McCord's attention in August. "If you say it's okay for private military groups to mass, carrying assault weapons at political confrontations," Zelikow said in an interview this week, "that's a powder keg."