The breakaway government of Nagorno-Karabakh said on Thursday that it would cease to exist, formally ending more than 30 years of separatist rule, a week after a swift attack by Azerbaijan returned the mountainous enclave to Azerbaijani rule.

In a decree published by the official news service of the Republic of Artsakh — the official Armenian name for Nagorno-Karabakh — the territory’s leader, Samvel Shakhramanyan, said that all government entities there would be dissolved by the end of the year. Ethnic Armenian residents of the territory should make their own decisions about whether they wanted to live under Azerbaijani rule or leave, the decree said.

The announcement amounted to a formal surrender of the breakaway territory, a pivotal area at the crossroads of great power interests in the Caucasus, and put a formal end to a long and bloody conflict in which tens of thousands of people lost their lives in two full-scale wars, with around a million displaced.

The government of Armenia said on Thursday that more than 68,000 “forcibly displaced” people had left the breakaway state to seek safety in Armenia.

Many more are expected to follow in coming days, with numerous refugees saying that they expected most ethnic Armenians to leave the enclave in what will likely turn into a major exodus. The process has been shocking to many Armenians, who consider Nagorno-Karabakh their ancient ancestral homeland.

The desperate situation was underlined on Monday when an explosion at a fuel depot near the territory’s capital, Stepanakert, killed at least 68 people, according to the local ombudsman. Another 105 people are still missing following the blast, which occurred as a large number of people lined up to get fuel to help them flee. The cause of the disaster remained unclear on Thursday.

Russian peacekeepers stationed in the region used military helicopters to shuttle more than 200 of those severely wounded in the blast to Armenia, where they were transferred to hospitals.

While the Azerbaijani authorities have allowed many ethnic Armenians to leave Nagorno-Karabakh, they have also arrested some of its leading figures. On Wednesday, the Azerbaijani security service detained Ruben Vardanyan, a former leader of the breakaway territory.

Mr. Vardanyan rose to prominence by cofounding a leading investment bank in Russia, and he has been involved in multiple major business and philanthropic projects. In 2022, he renounced his Russian citizenship and became the state minister of the Republic of Artsakh, the effective leader of the breakaway republic. He quit the post in February 2023.

The Azerbaijani State Security Service said in a statement on Thursday that Mr. Vardanyan was accused of financing terrorism, participating in illegal armed groups and crossing a state border illegally.

His detention raised concerns in the territory that the Azerbaijani authorities would arrest other leaders of the breakaway government.