Andriy Yermak was a constant, looming presence in Ukraine's government - a seemingly immovable figure on the political stage.

Despite his towering frame, you might not always have spotted him. Yet, wherever President Volodymyr Zelensky was, Yermak was often not far away.

As his chief of staff, Yermak wielded enormous power at the top of government and was even trusted to negotiate on Ukraine's behalf at peace talks with the US.

But as his influence grew, so did public resentment of the power this unelected official held. His political career came to an abrupt end on Friday, hours after anti-corruption investigators raided his home in Kyiv.

Yermak and Zelensky first met in 2011 when the former was an intellectual property lawyer and the latter a TV producer. After working together during the successful presidential campaign of 2019, Yermak became Zelensky's chief of staff. He stood next to the president as he gave his now famous we are still here speech as the Russians descended on Kyiv at the start of their full-scale invasion in February 2022.

As Zelensky concentrated his power over time, Yermak was widely viewed as the second most powerful person in Ukraine. He reportedly helped shape foreign policy, ousted political rivals, and even made battlefield decisions.

Ukrainian politics is shaped by big characters, and Zelensky's administration had not one, but two of them. Despite the favorable conditions Yermak enjoyed within the sprawling Presidential Office, the same couldn't be said outside its steep walls.

His popularity was nosediving.

Zelensky had successfully grappled with corruption scandals in the past, but in July a chain of events began that has shaken the current government to its core, weakening him politically and costing him his right-hand man.

That month, the president convinced parliament to formally remove the independence of Ukraine's two anti-corruption bodies and bring them under direct government control. At the time, Zelensky said it was to limit Russian interference. But the public - as well as the European Union - disagreed, and he was forced to U-turn after mass demonstrations.

By autumn, those same agencies, the National Anti-Corruption Bureau (Nabu) and the Special Anti-Corruption Prosecutor's Office (Sapo), released findings of a lengthy investigation that implicated members of Zelensky's inner circles. Senior figures, including two ministers and a former deputy prime minister, were accused of siphoning $100 million from public projects in the energy sector.

At a time when Russia is pummeling Ukraine's energy grid with missiles and drones, public anger at these corruption allegations has soared. Local media reported that investigators were combing through laptops and mobile phones seized from Yermak's flat during their search.

His resignation is a destabilizing factor during a critical time as Ukraine continues its fight. Talks will continue in the coming weeks as the government grapples with this unexpected transition. Observers are left wondering if this change will be a timely reboot for Kyiv, or a costly lack of continuity.

Yermak claims innocence and has said he will head to the front lines. Meanwhile, analysts express mixed feelings, suggesting Yermak's departure could symbolize a positive change in the pursuit of accountability within Ukraine's still-developing democratic institutions.