Armenia and Azerbaijan, two ex-Soviet republics in the Caucasus, are locked in a decades-long territorial dispute with deadly fighting erupting on Sunday.

Here are the key issues surrounding their conflict.

Nagorno Karabakh

At the heart of the standoff between Yerevan and Baku is the contested Nagorno Karabakh region.

The Soviet authorities merged the predominantly ethnic Armenian territory with Azerbaijan in 1921.

After the 1991 collapse of the Soviet Union, Armenian separatists seized it in a move supported by Yerevan.

An ensuing war left 30,000 dead and forced hundreds of thousands from their homes.

Despite a ceasefire mediated in 1994 by Russia, the United States and France, peace negotiations struggle to move forward and fighting erupts frequently.

The latest clashes on Sunday saw Azerbaijan and Armenian separatists accuse each other of igniting the fighting that left both sides with casualties, including civilians.

Smoke rises after Armenian attacks on Azerbaijan border in Azerbaijan

It followed a flare-up along the border in July which claimed the lives of 17 soldiers from both sides.

In April 2016, some 110 people were killed in the most serious fighting in years.

Revolts and dynasty

Armenia, a Christian country since the fourth century, has been rocked by political and economic instability since it gained independence from the former USSR.

The country's post-Soviet leadership repressed opposition to its rule, was accused of falsifying ballot results, and was largely beholden to the interests of Russia.

In the spring of 2018, mass street protests brought current Prime Minister Nikol Pashinyan to power. He has since cracked down on corruption and introduced popular judicial reforms.

Muslim-majority Azerbaijan, on the Caspian Sea, has been under the authoritarian grip of a single family since 1993.

Heydar Aliyev, a former officer of the Soviet security services, the KGB, ruled the country with an iron fist until October 2003. He handed over power to his son, Ilham, weeks before his death.

Like his father, Ilham has quashed all opposition to his rule and in 2017 made his wife, Mehriban, the country's first vice president.

Russia and Turkey

Turkey, with ambitions to be regional powerbroker in the Caucasus, has thrown its weight behind oil-rich and Turkic-speaking Azerbaijan.

Their alliance is fuelled by a mutual mistrust of Armenia, and Ankara routinely issues strongly worded statements in support of Baku's ambitions to reclaim Nagorno Karabakh.

People greet Azerbaijani service members in military vehicles in Baku

Yerevan harbours hostility towards Turkey over the massacres of some 1.5 million Armenians by Turkey under the Ottoman Empire during World War I.

More than 30 countries have recognised the killings as genocide, though Ankara fiercely disputes the term.

Russia, which maintains close ties with Armenia, is the major powerbroker in the region. It leads the Collective Security Treaty Organisation military alliance of ex-Soviet countries that includes Armenia.

Yerevan relies on Russian support and military guarantees because its defence budget is overshadowed by Azerbaijan's spending on arms.

Oil and diaspora

Azerbaijan has recently begun leveraging oil revenues as part of a bid to overhaul its image in the West.

Baku has invested in massive sponsorship deals including with the Euro 2020 football championship, which was postponed because of the coronavirus pandemic.

Baku was due to host matches this year and Azerbaijan has held Formula 1 Grand Prix races since 2016.

Azerbaijan has also tried to pitch itself to European countries as an alternative energy supplier to Russia.

On the international stage, Armenia has a vast and influential diaspora that fled during the Ottoman-era repressions.

Reality TV star Kim Kardashian, the late singer Charles Aznavour, and pop star and actress Cher all trace their roots to Armenia.

Some have appointed themselves unofficial ambassadors, like Kardashian who has been outspoken on the issue of the Armenian genocide.