Azerbaijan: a history from Gobustan to Karabakh

A Turkic, Muslim nation on the Caspian Sea, Azerbaijan founded the first democratic republic of the Muslim world in 1918 and regained Karabakh in 2020 and 2023. It is one of Pakistan's closest allies.

By Last reviewed

Azerbaijan
Azerbaijan and its neighbours. Borders approximate.

Key facts

Capital
Baku
Independence
18 October 1991 (first republic founded 28 May 1918)
Population
About 10 million
Language
Azerbaijani, a Turkic language
Religion
Mostly Shia Muslim, with a Sunni minority
Link with Pakistan
Close allies; Pakistan backs Azerbaijan on Karabakh and does not recognise Armenia

Through the ages

The main periods of Azerbaijan's history, 10000 BCE to today. Recent centuries are drawn wider so they can be read.

  1. Gobustan and early peoples10000 BCE to 400 BCE
  2. Caucasian Albania400 BCE to 705 CE
  3. Caliphate and the Shirvanshahs705 CE to 1501
  4. Safavid Iran and the khanates1501 to 1813
  5. Russian rule and the oil boom1813 to 1918
  6. Azerbaijan Democratic Republic1918 to 1920
  7. Soviet Azerbaijan1920 to 1991
  8. Independent Azerbaijan1991 to today

Timeline

  1. c. 10000 BCE
    Civilisation

    Gobustan

    People carve thousands of pictures of hunters, animals and boats into the rocks of Gobustan near the Caspian.

  2. c. 705 CE
    Empires and dynasties

    Islam arrives

    Arab armies of the caliphate complete their conquest of Caucasian Albania, and Islam spreads.

  3. c. 861 CE
    Empires and dynasties

    The Shirvanshahs

    The Shirvanshah dynasty begins ruling Shirvan. It lasts more than six centuries and later builds its palace in Baku.

  4. c. 1141
    Culture and faith

    Nizami Ganjavi

    The poet Nizami is born in Ganja. His Khamsa, five long poems in Persian, becomes one of the classics of Islamic literature.

  5. 1501
    Empires and dynasties

    The Safavids

    Shah Ismail I, who also wrote poetry in Azerbaijani Turkish, founds the Safavid Empire and makes Shia Islam the state religion.

  6. 1828
    Treaties and agreements

    The Treaty of Turkmenchay

    After the Gulistan treaty of 1813 and a second war, Iran cedes the northern khanates to Russia. The Aras river becomes the border, dividing Azerbaijanis between two states.

  7. c. 1872
    Economy

    The oil boom

    Industrial oil drilling begins in Baku. By 1900 it produces about half of the world's oil.

  8. 28 May 1918
    Independence

    The Azerbaijan Democratic Republic

    The first democratic republic in the Muslim world is proclaimed. In 1919 it gives women the vote.

  9. April 1920
    Wars and conflict

    Soviet takeover

    The Red Army invades and Azerbaijan becomes a Soviet republic.

  10. 20 January 1990
    Politics

    Black January

    Soviet troops storm Baku to crush the national movement, killing more than a hundred civilians.

  11. 18 October 1991
    Independence

    Independence

    Azerbaijan restores its independence. Türkiye and Pakistan are among the first to recognise it.

  12. 26 February 1992
    Wars and conflict

    Khojaly

    During the first Karabakh war, hundreds of Azerbaijani civilians are killed at Khojaly. By 1994 Armenian forces hold Karabakh and seven surrounding districts.

  13. September 1994
    Economy

    The Contract of the Century

    Azerbaijan signs a major oil deal with Western companies. The Baku-Tbilisi-Ceyhan pipeline opens in 2006.

  14. September to November 2020
    Wars and conflict

    The 44-day war

    Azerbaijan retakes the occupied districts and part of Karabakh, including Shusha. Pakistan voices strong support for Azerbaijan.

  15. September 2023
    Wars and conflict

    Karabakh restored

    A one-day operation restores Azerbaijani control over all of Karabakh. Most of its Armenian population leaves for Armenia.

  16. 8 August 2025
    Treaties and agreements

    Peace with Armenia

    The leaders of Azerbaijan and Armenia initial a peace agreement at the White House.

Ancient Azerbaijan

Azerbaijan lies on the western shore of the Caspian Sea, where the Caucasus mountains meet the plains. At Gobustan, south of Baku, people carved thousands of pictures of hunters, animals and reed boats into the rocks over many thousands of years. In ancient times the land was home to Caucasian Albania, a kingdom unrelated to the Balkan country, which adopted Christianity in the fourth century. The region’s name is often traced to Atropates, a Persian governor of the time of Alexander the Great. Arab armies brought Islam in the seventh and early eighth centuries, and later Turkic peoples, the Oghuz Turks, settled the land and gave it its language.

Shirvanshahs, Nizami and the Safavids

From the ninth century the Shirvanshah dynasty ruled the north for more than six hundred years and built its palace in Baku. In the twelfth century the city of Ganja produced Nizami, whose Persian romances, including Layla and Majnun and Khusraw and Shirin, were loved from Istanbul to Delhi and Lahore. In 1501 Shah Ismail I, a ruler who wrote poetry in Azerbaijani Turkish, founded the Safavid Empire and made Shia Islam the religion of Iran and Azerbaijan. After the Safavids, the land broke into small khanates.

Russia, oil and the first republic

Russia conquered the northern khanates from Iran in two wars, and the treaties of Gulistan in 1813 and Turkmenchay in 1828 made the Aras river the border, leaving many Azerbaijanis in Iran, as they still are. From the 1870s Baku’s oil wells made it one of the richest cities of the Russian Empire, producing about half of the world’s oil by 1900. On 28 May 1918 Azerbaijani leaders proclaimed the Azerbaijan Democratic Republic, the first democratic republic in the Muslim world, which gave women the vote in 1919. The Red Army ended it in April 1920.

Independence and Karabakh

Under Soviet rule Baku’s oil fuelled the Soviet war effort against Germany. As the Soviet Union weakened, Armenians in Karabakh demanded union with Armenia, and in January 1990 Soviet troops killed more than a hundred civilians in Baku. Azerbaijan restored its independence on 18 October 1991. In the war that followed, hundreds of civilians were killed at Khojaly in 1992, and by 1994 Armenian forces held Karabakh and seven surrounding districts, driving out hundreds of thousands of Azerbaijanis. Heydar Aliyev, president from 1993, signed major oil deals with Western firms, and his son Ilham Aliyev succeeded him in 2003. In a 44-day war in 2020 Azerbaijan retook most of the occupied land, and in September 2023 it restored control over all of Karabakh, after which most Armenians there left. In August 2025 the two countries’ leaders initialled a peace agreement in Washington.

Azerbaijan and Pakistan

Pakistan was among the first countries to recognise Azerbaijan’s independence. It has consistently supported Azerbaijan over Karabakh and does not have diplomatic relations with Armenia. With Türkiye, the two countries are often called the Three Brothers. They cooperate on defence, including a deal for Pakistani-made JF-17 fighter jets, and on energy and trade.

For our latest reporting on Azerbaijan, see the news listed on this page.

Landmarks and heritage

12th to 15th centuries

Walled City of Baku

Baku

The old city with the Palace of the Shirvanshahs and the Maiden Tower. A UNESCO World Heritage Site.

Many thousands of years

Gobustan Rock Art

Near Baku

More than 6,000 rock carvings. A UNESCO World Heritage Site.

18th century

Historic Centre of Sheki

Sheki

A Silk Road town with the painted Khan's Palace. A UNESCO World Heritage Site.

Terms you will meet in the news

Karabakh
The mountainous region of Azerbaijan held by Armenian forces from 1994 until 2020 and 2023.
Shirvanshahs
The dynasty that ruled Shirvan, in today's Azerbaijan, from the 9th to the 16th centuries.
Mugham
Azerbaijan's classical music tradition, recognised by UNESCO as intangible heritage.
Three Brothers
A popular name for the close partnership of Azerbaijan, Pakistan and Türkiye.

Quick answers

Why are Pakistan and Azerbaijan close?

They share faith and close ties with Türkiye. Pakistan was among the first to recognise Azerbaijan in 1991, backs it on Karabakh and does not recognise Armenia, and the two cooperate on defence and energy.

What was the Azerbaijan Democratic Republic?

The state proclaimed on 28 May 1918, the first democratic republic in the Muslim world. It gave women the vote in 1919 and fell to the Red Army in 1920.

What happened in Karabakh?

Armenian forces took Karabakh and seven nearby districts in a war that ended in 1994. Azerbaijan retook most of them in 2020 and the rest in September 2023.

Sources and further reading

Compiled by The Indus Compass from the sources above and standard reference works, and reviewed 29 November 2026. Dates before the modern era are approximate and some are debated by historians. Spotted a mistake? Tell the newsroom and we will correct it.