Baku is a city with a very ancient and rich history, mentions of it appear in the 5th century. Then Baku was known as one of the cities of Caucasian Albania. However, its origin dates back to an even earlier time, as evidenced by numerous archaeological finds: rock carvings - petroglyphs carved by primitive people on cave walls, rocks and stone blocks. The most ancient drawings belong to the Mesolithic era, however, it is assumed that life existed here before, which allows us to consider Gobustan one of the cradles of civilization. The drawings reflect various hunting scenes, ritual and ritual processes, worldview, customs and traditions of ancient Azerbaijanis.
The reason for the emergence of the city on the Absheron peninsula was various factors: favorable geographical location, warm, dry climate, fertile soil, the presence of natural resources, as well as its central location at the intersection of migration and trade routes "The Great Silk Road", протянувшегося с севера на юг, с запада на восток.
Since the second half of the IX century, Baku came under the ownership of the Shirvanshahs and became one of the main cities of Shirvan. The population was engaged in crafts, trade, fishing, gardening and oil production. In 1191, Shirvanshah Akhsitan I temporarily moved the capital of the state from Shamakhi to Baku.
During the invasion of the Mongols in the XIII century, the city fell into decline. But already in the next century, the economic life of Baku revived again. The Caspian Sea was even mentioned in some sources as the Baku Sea. Various goods were exported from Baku to the Golden Horde, the Russian principalities, Iran and Central Asia. Historical and architectural monuments - Bukhara Karvansaray (XIV century) and Multan (Indian) Karvansaray are still preserved in Baku, which testifies to Baku's trade relations with these regions. During the reign of Shirvanshah Khalillullah I (1417-1462). Significant construction works were carried out in Baku. The complex of the Shirvanshahs' Palace was created during this period.
In 1723, the city was taken by the troops of Peter I during the Persian campaign, and in 1735 it was returned to Iran. Undoubtedly, numerous wars and feudal strife could not but have a negative impact on the development of Baku, and in the 30s of the XVIII century. it was still a relatively small city in size. In addition, trade has decreased, and oil production volumes have decreased. Russian Russian troops occupied Baku in 1747 as the center of the Baku Khanate, which had existed since 1723. In 1806, during the Russo-Iranian War (1804-1813), the city was occupied by Russian troops, and after its end it became part of the Russian Empire. Since 1859 Baku is the center of Baku province.
Under the rule of the Russian Empire, Baku became one of the industrial and cultural centers of the Caucasus. Industrial oil production contributed to the development of the city. In 1847, an oil well was drilled mechanically for the first time in the world at the Bibi-Eibat field. An influx of foreign capital has begun in Baku, offices of the Rothschilds, the Nobel brothers and others have opened. In addition to the oil industry, weaving production developed, mechanical factories, tobacco factories, mills, processing enterprises, etc. were opened. On May 8, 1883, the Baku-Tbilisi railway was opened. Many migrants — Russians, Jews, Germans, Armenians, Iranian Azerbaijanis, etc. - came to the city.
With the oil boom, cultural life flourished, theaters opened, and an opera house was built. Baku became known as the "Paris of the Caucasus". The tolerance of local residents caused a lot of positive responses. None of the cultures or religions dominated in Baku.
On April 28, 1920, the Red Army entered the capital of Azerbaijan. In Soviet times, Baku became the capital of the Azerbaijan Soviet Socialist Republic and turned into one of the administrative, industrial, scientific and cultural centers of the USSR. After the collapse of the USSR, the sovereign Republic of Azerbaijan was proclaimed on October 18, 1991. Baku became the capital of an independent state for the second time in the history of the XX century.