Putin studied law at Leningrad State University, where his tutor was Anatoly Sobchak, later one of the leading reform politicians of the perestroika period. Putin served 15 years as a foreign intelligence officer for the KGB (Committee for State Security), including six years in Dresden, East Germany. In 1990 he retired from active KGB service with the rank of lieutenant colonel and returned to Russia to become prorector of Leningrad State University with responsibility for the institution’s external relations. Soon afterward Putin became an adviser to Sobchak, the first democratically elected mayor of St. Petersburg. He quickly won Sobchak’s confidence and became known for his ability to get things done; by 1994 he had risen to the post of first deputy mayor.