ALEXANDRIA, Va. (AP) — The government’s watchlist of more than 1 million people identified as “known or suspected terrorists” violates the constitutional rights of those placed on it, a federal judge ruled Wednesday.

The ruling from U.S. District Judge Anthony Trenga grants summary judgment to nearly two dozen Muslim U.S. citizens who challenged the watchlist with the help of the Council on American-Islamic Relations.

The judge is seeking additional legal briefs before deciding what remedy to impose.

The plaintiffs said they were wrongly placed on the list and that the government’s process for adding names is overbroad and riddled with errors.

The watchlist is disseminated to a variety of governmental departments, foreign governments and police agencies.

The FBI declined comment on the ruling Wednesday. In court, FBI lawyers argued that the difficulties suffered by the plaintiffs pale in comparison to the government’s interests in combating terrorism.

Gadeir Abbas, an attorney for the plaintiffs, called the ruling a victory. He said he will ask the judge to severely curtail how the government compiles and uses its list.

“Innocent people should be beyond the reach of the watchlist system,” Abbas said. “We think that’s what the Constitution requires.”

Abbas said that while there has been significant litigation over the no-fly list, which forced the government to improve the process for people seeking to clear their name from the list, Trenga’s ruling is the first to broadly attack the government’s use of the watchlist. Trenga wrote in his 31-page ruling that the case “presents unsettled issues.”

Ultimately, Trenga ruled that the travel difficulties faced by plaintiffs — who say they were handcuffed at border crossings and frequently subjected to invasive secondary searches at airports — are significant, and that they have a right to due process when their constitutional rights are infringed.

He said the concerns about erroneous placement on the list are legitimate.

“There is no evidence, or contention, that any of these plaintiffs satisfy the definition of a ‘known terrorist,’” Trenga wrote. And the alternate standard for placement — that of a “suspected terrorist” — can easily be triggered by innocent conduct that is misconstrued, he said.

The watchlist, also known as the Terrorist Screening Database, is maintained by the FBI and shared with a variety of federal agencies. Customs officers have access to the list to check people coming into the country at border crossings, and aviation officials use the database to help form the no-fly list, which is a much smaller subset of the broader watchlist.

The watchlist has grown significantly over the years. As of June 2017, approximately 1.16 million people were included on it, according to government documents filed in the lawsuit. In 2013, the number was only 680,000. The vast majority are foreigners, but according to the government, there were roughly 4,600 U.S. citizens and lawful permanent residents on the watchlist as of 2017.

Abbas argued at a court hearing this year that the intrusions imposed on those listed are all for naught and that the list is worthless in terms of preventing terrorism. He noted that Omar Mateen, the man who shot and killed 49 people at an Orlando nightclub in 2016, was at one time on the list but was removed from it. Others who have committed terrorist acts have never been included on the watchlist.

The lawsuit was filed in 2016, and has exposed previously unknown details about the list and how it is disseminated. In particular, government lawyers acknowledged after years of denials that more than 500 private entities are given access to the list.

Government lawyers describe those private agencies as “law enforcement adjacent” and include university police forces, and security forces and hospitals, railroads and even animal-welfare organizations.

Abbas said the revelations about the government’s actions have come after years of dismissive responses from government officials who accused the Council on American-Islamic Relations and others of paranoia, and that people are now paying more attention to the civil-rights implications of watchlisting.

The House of Representatives this year adopted a proposal from Democratic Minnesota Rep. Ilhan Omar that would force President Trump’s administration to disclose details about how it shares the watchlist with foreign countries.