Several activists from Washington State can continue with a lawsuit accusing two civilian employees of the United States Army of spying on organizers of protests against the wars in Iraq and Afghanistan, a federal appeals court ruled on Monday.

The ruling, from the United States Court of Appeals for the Ninth Circuit, in San Francisco, appears to clear the way for a trial involving assertions that the Army was involved in the surveillance of civilian groups, which several statutes forbid.

The activists filed the lawsuit in 2010 saying that John J. Towery, who worked as a criminal intelligence analyst for the force protection division at Joint Base Lewis-McChord, near Tacoma, Wash., infiltrated protest groups using the alias John Jacob. Mr. Towery then provided information on the groups to the Army, law enforcement agencies and private security firms in an effort to thwart protests and target the protesters, the lawsuit said.

“John Towery had an intimate knowledge of our personal lives, our relationships, our political beliefs, even actions we were planning,” said Brendan Maslauskas Dunn, one of the activists who filed the lawsuit. “People were followed. They were routinely harassed, detained and arrested.”