President Volodymyr Zelenskyy on Sunday fired the head of Ukraine's powerful domestic security agency and the state prosecutor general, because of what he called dozens of cases of collaboration with Russia by officials in their agencies.
The sackings of SBU chief Ivan Bakanov, a childhood friend of Mr Zelenskyy, and Prosecutor General Iryna Venediktova, who has played a key role in the prosecution of Russian war crimes, were announced in executive orders on the president's website.
They are easily the biggest political sackings since Russia invaded on February 24, forcing the entire Ukrainian state to focus on the war effort.
In a post on Telegram, Mr Zelenskyy said he fired the officials because it had come to light that many members of their agencies had collaborated with Russia, a problem he said touched other agencies as well.
He said 651 cases of alleged treason and collaboration had been opened against prosecutorial and law enforcement officials, and that more than 60 officials from Mr Bakanov and Ms Venediktova's agencies were now working against Ukraine in Russian-occupied territories.
The sheer number of treason cases lays bare the huge challenge of Russian infiltration faced by Ukraine as it battles in what it says is a fight for survival.
"Such an array of crimes against the foundations of the national security of the state … pose very serious questions to the relevant leaders," Mr Zelenskyy said.
"Each of these questions will receive a proper answer."
Russian troops have captured large areas of Ukraine's south and east during an invasion that has killed thousands, displaced millions and destroyed cities.
It remains unclear how the southern, Russian-occupied region of Kherson fell so quickly, in contrast to the fierce resistance around Kyiv that forced Russia to withdraw and focus on capturing the industrial Donbas heartland in the east.
In his nightly speech to the nation, Mr Zelenskyy noted the recent arrest on suspicion of treason of the SBU's former head overseeing the region of Crimea, the peninsula annexed by Russia in 2014 that Kyiv and the West still view as Ukrainian land.
Mr Zelenskyy said he had fired the top security official at the start of the invasion, a decision he said was now shown as justified.
"Sufficient evidence has been collected to report this person on suspicion of treason. All his criminal activities are documented," he said.
Mr Bakanov was appointed to lead the SBU in 2019, one of an array of new faces who rose to prominence after Mr Zelenskyy, a former comedian, won election that year.
Mr Zelenskyy appointed Oleksiy Symonenko as the new prosecutor general in another executive order published on his site.