From the Wikipedia page 
Saint Petersburg is a federal subject of Russia. The political life of Saint Petersburg is regulated by the city charter adopted by the city legislature in 1998.
The superior executive body is the Saint Petersburg City Administration, led by the governor (mayor before 1996). Saint Petersburg has a unicameral legislature, the Saint Petersburg Legislative Assembly.
According to the federal law passed in 2004, heads of federal subjects, including the governor of Saint Petersburg, are nominated by the President of Russia and approved by local legislatures. If the legislature disapproves the nominee, it is dissolved. The former governor, Valentina Matviyenko was approved according to the new system in December 2006; she moved to another job in Moscow and was replaced on Georgy Poltavchenko in 2011. In 2012, following passage of a new federal law, restoring direct elections of heads of federal subjects, the city charter was again amended to provide for direct elections of governor.
Saint Petersburg city is currently divided into eighteen administrative divisions.
Saint Petersburg is also the administrative center of Leningrad Oblast, and of the Northwestern Federal District.
Saint Petersburg and Leningrad Oblast, despite being different federal subjects, share a number of departments of federal executive agencies, such as courts of arbitration, police, FSB bureaux, postal services, drug enforcement administration, penitentiary service, federal registration service, and other federal services.