A public row erupted among the top ranks of the military in Ukraine on Thursday, risking throwing uncertainty over the war effort at a time when Kyiv is in one of its strongest positions in months.

The split came after President Volodymyr Zelenskyy shook up his wartime government, including replacing his popular defense minister, who had been brought in six months ago, but clashed with the traditional military establishment.

Thousands poured into the streets across Ukraine to protest the ouster of Mykhailo Fedorov, who has been seen as an innovator of the country's successful drone technology.

The overhaul, which also included replacing his prime minister, could become a test of Zelenskyy's political authority as Ukraine's fight against Russia's full-scale invasion approaches four-and-a-half years. Zelenskyy has remained in office under martial law because wartime elections are prohibited, but has periodically reshuffled his government.

The moves threw Ukraine's military leadership into an unwelcome crisis at a time when its actions against Russia are starting to bear fruit and as Moscow has unleashed unrelenting aerial attacks.