WRAPUP 8-Zelenskiy sidelines close allies in Kyiv's biggest purge of war

* Zelenskiy sidelines security chief, prosecutor

* Hundreds of treason, collaboration cases launched

* Security chief was childhood friend of president

By Tom Balmforth and Max Hunder

KYIV, July 18 (Reuters) - President Volodymyr Zelenskiy sidelined his childhood friend as head of Ukraine's security service and another close ally as top prosecutor in Kyiv's biggest internal purge of the war, citing their failure to root out Russian spies.

The careers of SBU security service chief Ivan Bakanov and Prosecutor General Iryna Venediktova had personified Zelenskiy's policy of putting young loyalists in charge of fighting corruption since the former TV comic came to power in 2019.

But nearly five months after Russia's invasion, the president acknowledged that his two allies had failed to root out traitors and collaborators in their organisations.

The deputy head of Zelenskiy's administration said on Monday they had been suspended pending further investigation.

More than 60 officials from Bakanov's SBU security agency and the prosecutor's office were working against Ukraine in Russian-occupied territory, and 651 treason and collaboration cases had been opened against law enforcement officials, Zelenskiy said in a video address.

"Such an array of crimes against the foundations of the national security of the state ... poses very serious questions to the relevant leaders," Zelenskiy said.

He appointed Vasyl Maliuk, first deputy head of the SBU since March 2020, as acting chief on Monday.

In a related matter, Zelenskiy said in a late Monday video address that a "personnel audit" of the SBU was under way and the dismissals of 28 officials for "unsatisfactory work results" was under consideration.

Despite Zelenskiy's comments on Russian infiltration of the service, the U.S. State Department on Monday said that Washington would continue sharing intelligence with Kyiv. U.S. officials have said Ukraine's military has used the information to respond to Moscow's invasion.

White House spokesperson Karine Jean-Pierre said the United States still would help Ukraine "defend against Russian aggression," document war crimes and pursue anti-corruption reforms. Zelenskiy, widely feted on the world stage as a decisive war-time leader, had been dogged before the invasion by accusations that he had named friends and other outsiders to jobs in which they were out of their depth.

Bakanov, a friend since their childhood in southern Ukraine, had helped run Zelenskiy's media business during his television career. He then led the campaign that saw Zelenskiy shift from playing the president on a sitcom to being elected in a landslide in real life.