In 1996 he moved to Moscow and started work in the Kremlin, where he was eventually appointed head of Russia's Federal Security Service (FSB) - the successor to the KGB - in 1998. Barely a year later he was named one of Russia's first deputy prime ministers and then acting prime minister by President Boris Yeltsin. When President Yeltsin resigned he was made acting president and officially elected president in March 2000.