MOSCOW — Russian President Vladimir Putin on Friday dismissed his chief of staff and longtime ally, Sergei Ivanov, a hawkish ex-KGB spy with impeccable English who was once rumored to become his successor.

Ivanov's firing follows a string of recent dismissals and demotions of political heavyweights whose association with Putin often dated back decades. Analysts say Putin is trying to limit the clout of a close circle of his old friends and former colleagues in the Soviet-era KGB whose influence went far beyond their job descriptions.

Ivanov, 63, was part of this circle in Leningrad, now St. Petersburg, and relocated to Moscow shortly after Putin became head of the Federal Security Service, or FSB, the main KGB successor agency, in 1998. Two years later, Putin was elected president, and Ivanov held the jobs of deputy prime minister and defense minister.

He oversaw important structural changes in Russia's military before the 2008 war with the former Soviet republic of Georgia that heralded Moscow's comeback as a major military force that does not hesitate to take up arms against its former Communist-era provinces.

In 2008, when constitutional limits did not allow Putin to be elected to a third consecutive presidential term, Ivanov was widely seen as Putin's likely successor. But bookish and Western-leaning lawyer Dmitry Medvedev, another protege of Putin's from St. Petersburg, was handpicked for the presidency instead, while Putin spent four years in the prime minister's chair.

Ivanov yet again became a deputy prime minister in charge of the country's military-industrial complex, a major source of Kremlin revenue and pride as Russian-made weapons won back the markets in Asia, the Middle East and Latin America that Moscow had lost after the Soviet collapse.

He was appointed head of the presidential administration in late 2012, shortly before Putin's return to the Kremlin. At the time, massive protests against presumed vote-rigging during a parliamentary vote were roiling Russia's largest cities, leading to Moscow's pivot to neoconservative, isolationist and anti-Western policies.

Ivanov's dismissal was staged as a televised conversation between him, his successor, Anton Vayno, and Putin — a traditional way of announcing news from the Kremlin in a country whose residents still rely on state-controlled television networks for important information.

Addressing Ivanov with a smile, Putin said he was appointing him as his envoy for transportation and environmental affairs, apparently aimed at creating an illusion of a promotion, another traditional way of reshuffling top Russian officials — who then usually drop out of public sight after assuming the new job.

“I do remember our agreement when you asked me not to keep you as head of the presidential administration for more than four years, and I understand why you wanted to choose another line of work,” Putin said, as the three sat in an opulent Kremlin office.

Analysts see Ivanov's dismissal as a court affair apparently rooted in Putin's attempts to restrain or even remove the old allies he promoted at the dawn of his presidency.

“Putin is slowly getting tired of his old friends and acquaintances he brought (to the Kremlin) himself,” Moscow-based political analyst Igor Korginyuk said in an interview. “They are of little use, but their influence is far too big.”

In the last year, several key allies and longtime associates of Putin have been dismissed or transferred to sinecures similar to Ivanov's. The head of Russian Railways, Vladimir Yakunin, resigned amid a corruption scandal involving his family's holdings. Drug czar Viktor Ivanov saw his entire anti-narcotics agency dismantled, and several longtime governors were fired in July.

“The old guard who put Putin on the throne are partially losing their positions,” Gennady Gudkov, a former lawmaker and opposition leader, said in an interview.