Baku (Azerbaijani: Bakı), sometimes known as Baqy, Baky, Baki or Bakou, is the capital, the largest city, and the largest port of Azerbaijan and entire Caucasus. Located on the southern shore of the Absheron Peninsula, the city consists of two principal parts: the downtown and the old Inner City (21.5 ha). Dating to antiquity, its urban population at the beginning of 2009 was estimated at just over two million people.
Baku is divided into eleven administrative districts (raions) and 48 townships. Among these are the townships on islands in the Baku Bay and the town of Oil Rocks built on stilts in the Caspian Sea, 60 km (37 mi) away from Baku. The Walled City of Baku along with the Shirvanshah's Palace and Maiden Tower were inscribed as a UNESCO World Heritage Site in 2000. According to the Lonely Planet's ranking Baku is also amongst the world's top ten destinations for urban nightlife.
The city also serves as the main financial hub of Azerbaijan. Many sizeable Azerbaijani facilities have their headquarters there, including SOCAR, one of the world's top 100 companies.
The first oil well was mechanically drilled in the Bibi-Heybat suburb of Baku in 1846, though a number of hand-dug well predate it. Large-scale oil exploration started in 1872, when Russian imperial authorities auctioned the parcels of oil-rich land around Baku to private investors. Within a short period of time Swiss, British, French, Belgian, German, Swedish and American investors appeared in Baku, among them were the firms of the Nobel brothers together with the family von Börtzell-Szuch (Carl Knut Börtzell, who also owned the Livadia Palace) and the Rothschild family. An industrial oil belt, better known as Black City, was established near Baku. By the beginning of the 20th century almost half of world production was being extracted in Baku.
In 1917, after the October revolution and amidst the turmoil of World War I and the breakup of the Russian Empire, Baku came under the control of the Baku Commune, which was led by veteran Bolshevik Stepan Shaumyan. Seeking to capitalize on the existing inter-ethnic conflicts, by spring 1918, Bolsheviks inspired and condoned civil warfare in and around Baku. During the infamous March Days, Bolsheviks and Dashnaks seeking to establish control over the Baku streets, faced with armed Muslim groups. Muslims suffered a crushing defeat by the united forces of the Baku Soviet and then felt the whole unbridled ferocity of Dashnak teams. Some 12 000 Azeri became the victims of the massacre carried out by radical Armenians and Bolshevik troops.
On 28 May 1918, the Azerbaijani faction of the Transcaucasian Sejm proclaimed the independent Azerbaijan Democratic Republic (ADR) in Ganja. Shortly after, Azerbaijani forces, with support of the Ottoman Army of Islam led by Nuru Pasha, started their advance into Baku, eventually capturing the city from the loose coalition of Bolsheviks, Esers, Dashnaks, Mensheviks and British forces under the command of General Lionel Dunsterville on 15 September 1918. Thousands of Armenians in the city were massacred in revenge for the earlier March Days. Baku became the capital of the ADR. On 28 April 1920, the 11th Red Army invaded Baku and reinstalled the Bolsheviks, making Baku the capital of the Azerbaijan Soviet Socialist Republic.