He studied law at Leningrad State University, graduating in 1975.[6] Putin was a KGB foreign intelligence officer for 16 years, rising to the rank of Lieutenant Colonel before resigning in 1991 to enter politics in Saint Petersburg. He moved to Moscow in 1996 and joined President Boris Yeltsin's administration where he served as director of the FSB, the KGB’s successor agency, and then as prime minister. He became Acting President on 31 December 1999, when Yeltsin resigned.