The landlocked mountainous region of Nagorno-Karabakh is the subject of an unresolved dispute between Azerbaijan, in which it lies, and its ethnic Armenian majority, backed by neighbouring Armenia.
In 1988, towards the end of Soviet rule, Azerbaijani troops and Armenian secessionists began a bloody war which left the de facto independent state in the hands of ethnic Armenians when a truce was signed in 1994.
Negotiations have so far failed to produce a permanent peace agreement, and the dispute remains one of post-Soviet Europe's "frozen conflicts."
The conflict has roots dating back well over a century into competition between Christian Armenian and Muslim Turkic and Persian influences.
Populated for centuries by Christian Armenian and Turkic Azeris, Karabakh became part of the Russian empire in the 19th century.
At a glance
- Territory is inside Azerbaijan, but population is mainly ethnic Armenian
- War followed 1991 declaration of independence; up to 30,000 killed, more than one million fled their homes
- Relations continued to be strained after 1994 ceasefire; first signs of a thaw appeared in 2008
Profile compiled by BBC Monitoring
The two groups lived in relative peace, although acts of brutality on both sides in the early 20th century live on in the popular memory.
After the end of World War I and the Bolshevik revolution in Russia, the new Soviet rulers, as part of their divide-and-rule policy in the region, established the Nagorno-Karabakh Autonomous Region, with an ethnic Armenian majority, within the Soviet Socialist Republic of Azerbaijan in the early 1920s.
As Soviet control loosened towards the end of the 1980s, smouldering Armenian-Azeri frictions exploded into violence when the region's parliament voted to join Armenia.
During the fighting, in which between 20,000 and 30,000 people are estimated to have lost their lives, the ethnic Armenians gained control of the region. The also pushed on to occupy Azerbaijani territory outside Karabakh, creating a buffer zone linking Karabakh and Armenia.
With the break-up of the Soviet Union, in late 1991, Karabakh declared itself an independent republic, further escalating the conflict into a full-scale war. That de facto status has not been recognised elsewhere.Ceasefire
A Russian-brokered ceasefire was signed in 1994, leaving Karabakh as well as swathes of Azeri territory around the enclave in Armenian hands.
During the fighting, in which more than one million fled their homes, the ethnic Azeri population - about 25% of the total before the war - fled Karabakh and Armenia while ethnic Armenians fled the rest of Azerbaijan. Neither population group has been able to return home since the end of the war.
Karabakh is a word of Turkic and Persian origin meaning "black garden", while "Nagorno-" is a Russian word meaning "mountain-". The ethnic Armenians prefer to call the region Artsakh, an ancient Armenian name for the area.
Both sides have had soldiers killed in sporadic breaches of the ceasefire. The closure of borders with Turkey and Azerbaijan has caused landlocked Armenia severe economic problems.
Since the truce, a simmering stalemate has prevailed. Azeris resent the loss of land they regard as rightfully theirs, while the Armenians show no sign of willingness to give it back.
Russia, France and the US co-chair the OSCE's Minsk Group, which has been attempting to broker an end to the dispute.Signs of thaw
In a December 2006 referendum, declared illegitimate by Azerbaijan, the region approved a new constitution. Nonetheless, there have since been signs of life in the peace process, with occasional meetings between the Armenian and Azeri presidents.
Significant progress was reported at talks between the leaders in May and November 2009, but progress then stalled, and in 2010-11 there were a number of serious ceasefire violations.