The earliest remains of mankind have been found in caves suggesting settlement around 700,000 years ago. By the 4th century the Transcaucasian, which consisted of present day Azerbaijan, Armenia and Georgia, was populated by people for whom Christianity was the main religion and was known as Albania (Or Caucasian Albania to differentiate it from present day Albania).
In the 4th Century the area was conquered by Shapur II the tenth king of the Sasanian Empire. The Sassanid were, in turn, defeated by Muslim Arabs in 667 A.D. when Christian resistance led by Prince Javanshir crumbled and Caucasian Albania became a vassal state. The inevitable conversion to Islam began.
In the 11th Century the Oghur Turks invaded the country and infused their Turkish dialect with the Persian language to create the distinctive Azerbaijan language of today.
The next major event in the history of Azerbaijan was the invasion by the Mongols from about 1220 onwards. The Mongol invasion destroyed many cities and by 1236 the whole territory was in the hands of Ögedei Khan. After the death of Tamerlane in 1405 his son reigned until the mid-15th Century but the region was eventually split into several principalities.
In 1501 the Safavids sacked Baku and a new Persian kingdom was formed with its capital in Tariz. The region soon became a battleground between the Persians and the Russians. The Safavid kingdom came to an end in 1722 when part of the region was occupied by the Ottoman Empire but the Russians occupied the coastal strip along the Caspian Sea.
Russia continued its battles to take over the region and eventually succeeded when much of the present day Azerbaijan was acquired by Russia from Persia through the Treaty of Gulistan in 1813 and then the Treaty of Turkmenchay in 1828.
At the end of the First World War the country seized its opportunity as the Russian Empire collapsed and it declared independence in Ganja on 28th May 1918. Independence was short lived and the newly created Soviet Union invaded Azerbaijan on 28th April 1920 and turned it into a Soviet Republic.
In 1922 Azerbaijan became a member of the Transcaucasian Soviet Federated Republic but in 1936 it became a separate republic within the Union of Soviet Socialist Republics.
With the late 1980s being a period of turmoil for Soviet Russia the Communist Party in Azerbaijan found itself under continuous pressure. Not least by the flaring up of an uprising by Armenian secessionists in the South-West region of Nagorno-Karabakh in 1988. The region, which had been created an autonomous region within Azerbaijan by the Soviets, saw some 30,000 people killed in the violence between its two communities, the Christian Armenians and the Turkic Azeri’s with the intervention of Soviet troops. A ceasefire in 1994 has done little to settle the simmering dispute between the two communities and the two states of Azerbaijan and Armenia who have taken sides.
The result of this and other nationalistic protests resulted in a violent confrontation between Soviet troops and demonstrators in Baku in January 1990 which saw 132 people killed. Azerbaijan declared independence from Russia on 30th August 1991 and became a member of the Commonwealth of Independent States in 1992.
Elections took place on 7th June 1992 and Abulfaz Elchibey, the leader of the newly founded Azerbaijani Popular Front Party (APFP), became the first president of the newly independent state.
Elchibey was ousted by parliament a year later and in fresh presidential elections Heydar Aliyev, a former Communist leader and leader of the newly founded New Azerbaijan Party (YAP) was elected president with 98.8% of the vote in October 1993.
Heydar Aliyev was re-elected in 1998 with 77.6% of the vote and in 2003, a few months before his death, he made his son, Ilham Aliyev, Prime Minister. The old president withdrew from the 2003 presidential election in favour of his son who was elected in a landslide with 76.8% of the vote. The result was greater in 2008 when incumbent President Ilham Aliyev won 87.34% of the vote.
In 2009 a referendum abolished term limits for the presidency allowing the president to stand once more in 2013; the same referendum also limited press freedom. In 2010 a parliament was elected with 72 of the 125 seats in the National Assembly going to the New Azerbaijan Party (YAP) with the balance going to two small parties and independents all of whom supported the president.
It is no surprise then that President Ilham Aliyev won the 2013 presidential election with around 84.5% of the vote.
The President is elected by popular vote for a five-year term and may serve an unlimited number of terms.
The unicameral National Assembly or Milli Majlis has 125 members elected to serve five-year terms.
The Transparency International Corruption Perceptions Index (CPI) 2016 places Azerbaijan at joint 123rd out of 176 countries with a CPI 2016 score of 30 (where 100 is least corrupt).