KHARKIV, Ukraine — Viktor appeared nervous as masked Ukrainian security officers in full riot gear, camouflage and weapons pushed into his cluttered apartment in the northern city of Kharkiv. His hands trembled and he tried to cover his face.

The middle-aged man came to the attention of Ukraine’s Security Service, the SBU, after what authorities said were his social media posts praising Russian President Vladimir Putin for “fighting with the Nazis,” calling for regions to secede and labeling the national flag “a symbol of death.”

“Yes, I supported (the Russian invasion of Ukraine) a lot. I’m sorry. … I have already changed my mind,” said Viktor, his trembling voice showing clear signs of duress in the presence of the Ukrainian security officers.

“Get your things and get dressed,” an officer said before escorting him out of the apartment. The SBU did not reveal Viktor’s last name, citing their investigation.

Viktor was one of nearly 400 people in the Kharkiv region alone who have been detained under anti-collaboration laws enacted quickly by Ukraine’s parliament and signed by President Volodymyr Zelenskyy after Russia’s Feb. 24 invasion.

Offenders face up to 15 years in prison for collaborating with Russian forces, making public denials about Russian aggression or supporting Moscow. Anyone whose actions result in deaths could face life in prison.

“Accountability for collaboration is inevitable, and whether it will happen tomorrow or the day after tomorrow is another question,” Zelenskyy said. “The most important thing is that justice will be served inevitably.”

Although the Zelenskyy government has broad support, even among many Russian speakers, not all Ukrainians oppose the invasion. Support for Moscow is more common among some Russian-speaking residents of the Donbas, an industrial region in the east. An eight-year conflict there between Moscow-backed separatists and Ukrainian government forces had killed over 14,000 people even before this year’s invasion.

Some businessmen, civic and state officials and members of the military are among those who have gone over to the Russian side, and Ukraine’s State Bureau of Investigations said more than 200 criminal cases on collaboration have been opened. Zelenskyy has even stripped two SBU generals of their rank, accusing them of treason.

A “registry of collaborators” is being compiled and will be released to the public, said Oleksiy Danilov, head of Ukraine’s Security Council. He refused to say how many people were targeted nationwide.

Under martial law, authorities have banned 11 pro-Russian political parties, including the largest one that had 25 seats in the 450-member parliament – the Opposition Platform For Life, which was founded by Viktor Medvedchuk, a jailed oligarch with close ties to Putin.

Authorities say pro-Russian activists in southeastern Ukraine, the scene of active fighting, are acting as spotters to direct shelling.

“One of our key goals is to have no one stab our armed forces in the back,” said Roman Dudin, head of the Kharkiv branch of the SBU, in an interview with The Associated Press. He spoke in a dark basement where the SBU moved its operations after its building in central Kharkiv was shelled.

The Kharkiv branch has been detaining people who support the invasion, call for secession and claim that Ukrainian forces are shelling their own cities.

Allegations of collaborating with the enemy carry strong historic resonance in Ukraine. During World War II, some in the region welcomed and even cooperated with invading forces from Nazi Germany after years of Stalinist repression that included the “Holodomor” – a man-made famine believed to have killed 4 million Ukrainians. For years afterward, Soviet authorities cited the cooperation of some Ukrainians with the Nazis as a reason to demonize today’s democratically elected leaders of Ukraine.

Human rights advocates know of “dozens” of detentions of pro-Russian activists in Kyiv alone since the new laws were passed, but how many have been targeted nationwide is unclear, said Volodymyr Yavorskyy, coordinator at the Center for Civil Liberties, one of Ukraine’s largest human rights groups.

“There is no complete data on the (entire) country, since it is all classified by the SBU,” Yavorskyy told AP.

“Ukrainian authorities are actively using the practice of Western countries, in particular the U.K., which imposed harsh restrictions on civic liberties in warring Northern Ireland. Some of those restrictions were deemed unjustified by human rights advocates, but others were justified, when people’s lives were in danger,” he said.

A person in Ukraine can be detained for up to 30 days without a court order, he said, and antiterrorism legislation under martial law allows authorities not to tell defense attorneys about their clients being remanded.

“In effect, these people disappear, and for 30 days there’s no access to them,” Yavorskyy said. “In reality, (law enforcement) has powers to take anyone.”

The government knows the implications of detaining people over their opinions, including that it risks playing into Moscow’s line that Kyiv is repressing Russian speakers. But in wartime, officials say, freedom of speech is only part of the equation.

“The debate about the balance of national security and ensuring freedom of speech is endless,” Foreign Minister Dmytro Kuleba told AP.

Ravina Shamdasani, a spokeswoman for the U.N. human rights office, said her agency has documented “cases of arrests and detention allegedly made by Ukrainian law enforcement authorities, which may involve elements of human rights violations” and is following up with the Ukrainian government.

She said her office is looking into eight cases that “appear to be disappearances of people considered as ‘pro-Russian,’ and we have documented two cases of unlawful killings of ‘pro-Russians,’” along with cases of vigilantism, in which law enforcement and others punish those suspected of being pro-Russian,

In the town of Bucha, now a symbol of horrific violence in the war, Mayor Anatoly Fedoruk said collaborators gave invading troops the names and addresses of pro-Ukrainian activists and officials in the city outside Kyiv, with hundreds of civilians shot to death with their hands tied behind their backs or their bodies burned by Russian forces.

“I saw these execution lists, dictated by the traitors -– the Russians knew in advance who they’re going to, at what address, and who lives there,” said Fedoruk, who saw his own name on one list. “Of course, Ukrainian authorities will search for and punish these people.”

In the besieged port city of Mariupol, officials accused collaborators of helping the Russians cut off electricity, running water, gas and communications in much of the city.

“Now I understand perfectly why the Russians were carrying out such precise, coordinated strikes on objects of critical infrastructure, knew about all locations and even times when Ukrainian buses evacuating refugees were supposed to depart,” said Mayor Vadym Boychenko.

Political analysts say the invasion and the brutality by Russian troops against civilians have turned off many Moscow sympathizers. Still, many such supporters remain.

“Russian propaganda took deep roots and many residents of the east who watch Russian TV channels believe absurd claims that it’s Ukrainians who are shelling them and other myths,” Volodymyr Fesenko of the Penta Center think tank told AP. “Naturally, Ukrainian authorities in the southeast are afraid of getting stabbed in the back and are forced to tighten security measures.”

Unlike Viktor, whose Kharkiv apartment was raided, 86-year-old Volodymir Radnenko didn’t seem surprised when Ukrainian security arrived to search his flat Saturday after detaining his son, Ihor. The military said the son was suspected of helping the Russians in shelling of the city — some of which occurred in Radnenko’s neighborhood about 15 minutes before the officers showed up, with the smell of smoke lingering. At least two people were killed and 19 others wounded in the region.

“He is used to thinking that Russia is all there is,” Radnenko told AP after the officers left. “I ask him: ’So who is shelling us? It’s not our (people), it’s your fascists.’ And he only gets angry at that.”