“WHOSE proposals do you listen to, who do you trust?” So asked three journalists writing Vladimir Putin’s biography when he first took office 17 years ago. “Who do I trust? Sergei Ivanov,” the then largely unknown Mr Putin responded. Mr Ivanov, a former KGB man from Mr Putin’s home town of Leningrad, has stood by Mr Putin’s side ever since, first as defence minister, then as deputy prime minister and, since 2011, as Mr Putin’s powerful chief of staff. On August 12th, Mr Putin unexpectedly dismissed Mr Ivanov, demoting him to special representative for ecology and transportation.

Mr Ivanov’s firing marks a major shake-up within the Kremlin, and comes at a sensitive time. Parliamentary elections loom in mid-September, at a time when the economy is under strain. And tension with Ukraine is escalating over Russian claims that Ukraine attempted to stage a terrorist attack in Crimea; Russia deployed powerful S-400 air defence systems to Crimea, while Dmitry Medvedev, the prime minister, warned that diplomatic relations with Ukraine could be severed.

Long considered one of the most influential figures in the Russian elite, Mr Ivanov is said to have been among the small circle consulted on the decision to annex Crimea in 2014. His hawkish views have been ascendant during the ensuing conflict in Ukraine and standoff with the West. He also played a major role in lobbying for Russia’s intervention into Syria.

Although Mr Ivanov and Mr Putin have known each other and worked closely together for decades, their relationship is not without tensions. In the KGB during the 1970s and 80s, Mr Ivanov served in the elite first directorate for intelligence, while Mr Putin was in the less prestigious second directorate for counterintelligence. After Mr Putin took the reins of the successor organisation, the Federal Security Service, in 1998, he recruited Mr Ivanov to join him. A fluent English speaker, Mr Ivanov served as a go-between with the administration of George W. Bush, bonding with Condoleezza Rice, Mr Bush’s National Security Adviser and later Secretary of State, over a shared passion for ballet. Yet despite his ambitions—or, more likely, because of them—Mr Ivanov lost the contest to succeed Mr Putin as president in 2008 to Mr Medvedev, who loyally ceded the seat back to him in 2012.

Although Mr Ivanov claimed that he left of his own volition, most observers believe he was sacked; if so, it would be the most dramatic sign of growing tension within the Kremlin. The move is the most high-profile of a string of personnel changes inside the Russian elite in recent months. Several regional and security services heads were rotated out last month, many in favour of younger officials personally loyal to Mr Putin, including several former bodyguards. The new head of the presidential administration, Anton Vaino, also fits that profile. Just 44 years old, Mr Vaino, the grandson of a Soviet-era Estonian communist party leader, began his career in the foreign service. He joined Mr Putin’s presidential office in 2002, working his way up the ranks with little fanfare. Vedomosti, a Russian business daily, described the new chief of staff as “Putin’s own man.” Two decades on, Mr Putin is now starting to rely on new friends.