Valentin Nalyvaichenko, head of the Security Service of Ukraine (SBU), is in trouble again. On June 15, Ukrainian President Petro Poroshenko said he was “unsatisfied” with Nalyvaichenko’s work. Three days later, Ukraine’s parliament dismissed him.

At a time when the Minsk II ceasefire agreement is a ceasefire in name only and the threat of Russian espionage, sabotage, and invasion loom on a daily basis, sacking the country’s intelligence chief for political reasons is risky. Then again, this is not the first time there has been speculation about Nalyvaichenko’s dismissal. However, in each case, Nalyvaichenko’s performance in fighting Russian aggression had kept him in the job. The fact that he’s reportedly been offered at least two government posts suggests that Poroshenko still needs Nalyvychenko. So don’t write his political obituary yet.

How was the country’s intelligence chief toppled?

Nalyvaichenko’s standoff with former Deputy Prosecutor General Anatoliy Danylenko made him front-page news—something that most spymasters studiously avoid. Nalyvaichenko was abruptly summoned to testify before the Ukrainian Prosecutor General’s Office about an enormous fire that was sparked by a fuel depot blast on June 8 and continues to burn. The depot, owned by BSRM-Nafta oil firm, is thirty kilometers from Kyiv. However, that wasn’t the real reason Nalyvaichenko was summoned. On June 12, he accused Danylenko of covering up corruption at BSRM-Nafta and co-owning the company. When summoned, the SBU chief gave documents to the prosecutor general’s office linking former Minister of Fuel and Energy Eduard Stavytskiy and Danylenko in a deal that resulted in the loss of one billion hryvnas (about $47 million) to the state budget over the last year. Nalyvaichenko reciprocated by summoning Danylenko to the SBU’s office for questioning on June 16.

Nalyvaichenko’s trouble didn’t end there. Poroshenko Bloc MP Serhiy Leshchenko released a document confirming old rumors that Right Sector’s Dmitro Yarosh worked for Nalyvaichenko when he was a member of parliament from 2012 to 2014. While the connection between the two raises some questions about the events of Euromaidan and the origins of Right Sector, this attack alone wasn’t enough to discredit Nalyvychenko. Yarosh is now a member of parliament and an advisor to the chief of general staff of the Ukrainian army. In other words, Yarosh has been legitimized by the political establishment.

After the Yarosh connection failed to deliver the knockout punch, rumors resurfaced about Nalyvaichenko’s connection to oligarch Dmytro Firtash. Firtash was arrested on suspicion of bribery and then released on bail in Vienna last year. He denies the corruption charges against him, and in April, an Austrian court turned down a US extradition request, saying there was not enough evidence. The rumors are loosely based around Firtash being a member of organized crime, his backing of Kyiv Mayor Vitali Klitchko, and Nalyvaichenko being a member of Klitchko’s UDAR Party. The rumors then morphed into allegations that Firtash insisted upon Nalyvaichenko’s appointment as SBU Head and that he provided financial backing to get him there. But these allegations don’t make much sense: Nalyvaichenko was confirmed as SBU Head on February 23, 2014 and his nomination was approved by parliament, the coalition of Yatsenyuk-Klitchko-Tyahnybok, and Poroshenko. Those who removed Nalyvaichenko were the very ones who approved his nomination.

It’s true that Nalyvaichenko knows Firtash personally. But Ukraine’s top spymaster should have a relationship with the country’s richest oligarchs. An effective spy needs relationships with people who are doing both good and bad things, especially since Ukraine lacks superior signal intelligence and relies heavily on human intelligence. Given the war and Russia’s extensive intelligence network in Ukraine, the fact that Nalyvaichenko knows Yarosh and Firtash is not a bad thing or necessarily a red flag. While guilt by association was not enough to remove Nalyvychenko, Poroshenko’s wishes were.

But why now? Others wanted his post—including some in the SBU. The oil depot fire gave Nalyvaichenko’s enemies a pretext to try and oust him.

Now that Nalyvaichenko has been sacked, he’s likely to turn up as the SBU’s head of external intelligence or vice prime minister for European integration. Possible replacements for SBU chief include First Deputy SBU Head Vitaliy Hritsak, although Deputy Presidential Chief of Staff Andriy Taranov and former Kuchma-era SBU Chief Ihor Smeshko have been mentioned. None of the potential SBU replacements have close ties to Russia.

But don’t write off Nalyvaichenko yet. Mark Twain once said, “Reports of my death have been greatly exaggerated.” In Nalyvaichenko’s case, reports of his political death may prove to be “greatly exaggerated.”

Brian Mefford is a Nonresident Senior Fellow at the Atlantic Council’s Dinu Patriciu Eurasia Center. He is a business and political consultant who is based in Kyiv, Ukraine. This piece was adapted from Mefford’s blog.