Baku is the capital of Azerbaijan. It was also the capital of Shirvan (during the reigns of Akhsitan I and Khalilullah I), the Baku Khanate, the Azerbaijan Democratic Republic and the Azerbaijan SSR and the administrative center of Russian Baku governorate. Baku is derived from the old Persian Bagavan, which translates to "City of God".Ашурбейли Сара. История города Баку: период средневековья. Баку, Азернешр, 1992 A folk etymology explains the name Baku as derived from the Persian Bādkube (بادکوبه ), meaning "city where the wind blows", due to frequent winds blowing in Baku. However, the word Bādkube was invented only in the 16th or 17th century, whereas Baku was founded at least before the 5th century AD.Ашурбейли Сара. История города Баку.

Names in mediaeval sources

Centuries/YearsSourcesName of Baku5th–8th century ADMovses Khorenatsi Anania ShirakatsiAtli-Bagavan Ateshi-Bagavan

or simply Bagavan930 ADIstakhriBakuh943–944 ADAl-MasudiBakuh942–952 ADAbu DulafBakuya982 ADHudud al-'AlamBaku985 ADAl-MuqaddasiBakuh12th centuryKhaqaniBaku13th centuryYaqut al-Hamawi Nasir al-Din al-TusiBakuya14th centuryRashidaddinBaku15th centuryAbdurrashid BakuviBakuya16th centuryHasan bey RumluBaku17th centuryEvliya ChalabiBaku

Starting from the 13th century AD the name of Baku begins to appear in mediaeval European Sources. Spelling of the name varies from Vahcüh (Pietro Della Valle), to Bakhow, Baca, Bakuie and Backu.

On the coins minted by Shirvanshahs, the name appears as Bakuya.

Other explanations

Various different hypotheses have been proposed to explain the etymology of the word Baku. According to L.G.LopatinskiГан К.Ф. Oпыть объяснения кавказских географических названий. Тифлис, 1909 and Ali HuseynzadeThe Name “Baku” "Baku" is derived from Turkic word for "hill". K.P. Patkanov, a specialist in Caucasian history, also explains the name as "hill" but in Lak language.

Prehistoric and ancient history Around 1000 years ago, the territory of modern Baku and Absheron was a savanna with rich flora and fauna. Traces of human settlement go back to the Stone Age. From the Bronze Age there have been rock carvings discovered near Bayil, and a bronze figure of a small fish discovered in the territory of the Old City. This has led some to suggest the existence of a Bronze Age settlement within the city's territory.Город Баку... Retrieved on 24 June 2006 Near Nardaran in a place called Umid Gaya, a prehistoric observatory was discovered, where on the rock the images of the sun and various constellations are carved together with a primitive astronomic table.Ancient Observatory of Absheron. Gobustan, No 3 (1973) Further archaeological excavations revealed various prehistoric settlements, native temples, statues and other artefacts within the territory of the modern city and around it.

In the 1st century, Romans organized two Caucasian campaigns and reached Baku. Near Baku, in Gobustan, Roman inscriptions dating from 84–96 AD were discovered. The remnant of this period is the village of Ramana in the Sabunchu district of Baku.

In the Life of the Apostle Bartholomew, Baku is identified as Armenian albanus. Some historians assume that during the existence of Caucasian Albania Baku was called Albanopolis.City of Baku – Administrative Department of the President of the Republic of Azerbaijan Local church traditions record the belief that Bartholomew's martyrdom occurred at the bottom of the Maiden Tower within the Old City, where according to historical data, a Christian church was built on the site of the pagan temple of Arta.

A record from the 5th-century historian Priscus of Panium was the first to mention the famous Bakuvian fires (ex petra maritima flamma ardet – from the maritime stone flame emerges). Owing to these eternal fires Baku became a major center of ancient Zoroastrianism. Sassanid Shah Ardashir I gave orders "to keep an inextinguishable fire of the god Ormazd" in the city temples.Город-крепость Баку Retrieved on 24 June 2006

Medieval and early modern period

There is little or no information regarding Baku in medieval sources until the 10th century. The earliest numismatic evidence found in the city is an Abbasid coin dating from the 8th century AD. At that time Baku was a domain of the Arab Caliphate and later of Shirvanshahs. During this period, they frequently came under assault by the Khazars and (starting from the 10th century) the Rus. Shirvanshah Akhsitan I built a navy in Baku and successfully repelled another Rus assault in 1170. After a devastating earthquake struck Shamakhy, the capital of Shirvan, Shirvanshah's court moved to Baku in 1191. A mint was put into operation."Ичери Шехер": быть или не быть Retrieved on 25 June 2006

Between the 12th and 14th centuries, a massive fortification was undertaken in the city and around it. The Maiden Tower, castles of Ramana, Nardaran, Shagan and Mardakan, and also the famous Sabayel castle on the island of the Baku Bay was built during this period. The city walls were also rebuilt and strengthened.

The biggest problem of Baku during this time was the transgression of the Caspian Sea. The rising levels of the water from time to time engulfed much of the city and the famous castle of Sabayel went completely into the sea in the 14th century. These led to several legends about submerged cities such as Shahriyunan ("Greek city").

Hulagu Khan occupied Baku under the domain of the Shirvan state during the third Mongol campaign in Azerbaijan (1231–1239) and it became a winter residence for Ilkhanids. In the 14th century, the city prospered under Muhammad Oljeitu who relieved it from some of the heavy taxes. Bakuvian poet Nasir Bakui wrote a panegyric to Oljeitu thus creating the first piece of poetry in the Azerbaijani language.

Marco Polo had written of Baku oil exports to Near Eastern countries.Yusif Mir-Babayev. Azerbaijan's Oil History. A Chronology Leading up to the Soviet Era. Retrieved on 24 June 2006 The city also traded with the Golden Horde, the Moscow Princedom, and European countries.

In 1501, Safavid shah Ismail I laid siege to Baku. The besieged inhabitants resisted, relying for defence on their fortifications. Due to the resistance, Ismail ordered part of the fortification wall to be undermined. The fortress's defense was destroyed and many inhabitants were slaughtered. In 1538, the Safavid Shah Tahmasp I put an end to the Shirvanshahs' reign and in 1540, Baku was recaptured by Safavid troops again.

Between 1568 and 1574 there is a record of six English missions to Baku. English men named Thomas Bannister and Jeffrey Duckett described Baku in their correspondence. They wrote that the "...town is a strange thing to behold, for there issueth out of the ground a marvellous quantity of oil, which serveth all the country to burn in their houses. This oil is black and is called nefte. There is also by the town of Baku, another kind of oil which is white and very precious, and it is called petroleum."SOCAR Section: Baku Oil and the Cycle of History Retrieved on 4 July 2006 The first oil well outside of Baku was drilled in 1594 by a craftsman named A. Mamednur oglu. This man finished the construction of a high-efficiency oil well in the Balakhany settlement.Шаммазов А.М. История развития нефтегазовой промышленности. 1999 This area was historically outside city territory.

In 1636, German diplomat and traveller Adam Olearius described Baku's 30 oil fields, noting that there was a great quantity of brown oil. In 1647, famous Turkish traveller Evliya Çelebi visited Baku. In April 1660, Cossacks under Stepan Razin attacked the Baku coast and plundered the village of Mashtaga. In 1683, Baku was visited by the ambassador of the Kingdom of Sweden, Engelbert Kaempfer. In the following year, Baku was temporarily recaptured by the Ottoman Empire.

Baku is noted for being a focal point for traders from all across the world during the Early modern period, commerce was active and the area was prosperous. Notably, traders from the Indian subcontinent established themselves in the region. These Indian traders built the Ateshgah of Baku during the 17th–18th centuries; the temple was used as a Hindu, Sikh, and Parsi place of worship.

Fall of Safavids and Baku Khanate

The fall of the Safavid dynasty in 1722 caused widespread chaos. Baku was invaded by the Russian and Ottoman empires.

On 26 June 1723, after a long siege, Baku surrendered to the Russians and the Safavids were forced to cede the city alongside many other of their Caucasian territories. In accordance with Peter the Great's decree, the soldiers of two regiments (2,382 people) were left in the Baku garrison under the command of Prince Baryatyanski, the commandant of the city. Peter the Great, while equipping a new military expedition commanded by General Mikhail Matyushkin, charged him with sending more oil from Baku to St. Petersburg, "which is a basis of an eternal and sacred flame"—Old Russian: "коя является основой вечного и священного пламени". However, due to Peter's death, this order was not carried out.

In 1733, Baku was visited by physician Ioann Lerkh, an employee of the Russian embassy and, like many others before him, described the city's oil fields. By 1730, the situation had deteriorated for the Russians as Nadir Shah's successes in Shirvan forced the Russians to make an agreement near Ganja on 10 March 1735, ceding the city and all other conquered territories in the Caucasus back to Persia.

After the disintegration of the Safavid Empire and after the death of Nader Shah, the semi-independent principality of Baku Khanate was formed in 1747 following the power vacuum which had been created. It was ruled by Mirza Muhammed Khan and soon became a dependency of the much stronger Quba Khanate. The population of Baku was small (approximately 5,000), and the economy was ruined as a result of constant warfare, banditry, and inflation. The Khans benefited, however, from the sea trade with the rest of Iran. Feudal infighting in the 1790s resulted in the dominance of an anti-Russian faction in the city resulting in the Russian-leaning brother of the Khan being exiled to Quba.

By the end of the 18th century, Tsarist Russia now began a more firm policy with the intent to conquer all of the Caucasus at the expense of Persia and Ottoman Turkey. In the spring of 1796, by Yekaterina II's order, General Valerian Zubov's troops started a large campaign against Qajar Persia following the sack of Tbilisi and Persia's aim to restore its suzerainty over Georgia and Dagestan. Zubov had sent 13,000 men to capture Baku, and it was overrun subsequently without any resistance. On 13 June 1796, a Russian flotilla entered Baku Bay, and a garrison of Russian troops was placed inside the city. Later, however, Pavel I ordered the cessation of the campaign and the withdrawal of Russian forces following the death of his predecessor, Yekatarina II. In March 1797, the tsarist troops left Baku.

Russian Imperial era