HONG KONG When the sturdy body of S. Erdene was enveloped in flames, Mongolia was brought face to face with the perils faced by its commodity-dependent economy in the most graphic way possible.

Erdene, a union leader at a state-owned coal mine called Tavan Tolgoi, was protesting layoffs at a press conference in Ulaanbaatar on Nov. 13 when he abruptly set himself on fire in front of dozens of journalists. "The government no longer supports our company, families of the workers are forced to starve," he said just before the flames took hold. Erdene survived, but suffered burns to 40% of his body, according to a report by AKI Press, a Central Asian news agency.

Plagued by mismanagement and deteriorating market conditions, it took only three years for Tavan Tolgoi to go from boom to bust -- a trajectory the whole country is at risk of following.

A mining frenzy that unfolded in the first decade of the millennium turned Mongolia and its vast mineral reserves into one of the most remote and unexpected frontiers of the global commodities boom. For a while, all went well. Mongolia made international headlines in 2011 when its gross domestic product rocketed 17.5% in a single year.

Foreign direct investment leaped to more than $4.6 billion, equivalent to 44% of GDP, as the Anglo-Australian mining conglomerate Rio Tinto sank billions of dollars into a copper and gold mine called Oyu Tolgoi.

However, events quickly took a dangerous turn. The government used the proceeds of a $250 million coal supply deal between Tavan Tolgoi and China's state-owned aluminum company Chalco to hand out money directly to the people. In the international bond markets, Mongolia made a sparkling debut with a $1.5 billion issue of dollar-denominated bonds on favorable terms.

With the benefit of hindsight, both deals worked out badly. With its coffers drained by state giveaways, Tavan Tolgoi was hit hard when coal prices collapsed. Now it is on the verge of failure.

SOUNDING THE ALARM On the national level, things are little better. The government faces debt repayments of $1.1 billion between 2017 and 2018 -- a sum that the country's foreign reserves would barely cover. With the mining supercycle headed south, and foreign investors put off by legal uncertainties created by capricious Mongolian policymaking in the good years, international observers are sounding the alarm.

Standard & Poor's and Fitch, two of the big three international credit ratings agencies, downgraded the country's sovereign debt rating in November, citing slower economic growth, now expected at about 1% in 2016, and growing fiscal and external imbalances.

Mongolia's central bank thinks the outsiders are overly gloomy about the country's prospects. "Ratings agencies don't see what we achieved in terms of reducing the current account deficit and inflation," said Naidansuren Zoljargal, governor of the Bank of Mongolia.

The current account deficit fell to 5.4% of GDP in 2015 from 27.4% in 2012 as trade surpluses grew, according to World Bank estimates. Weakening domestic demand has eased inflationary pressures, with annual consumer price inflation falling to 3.4% in October 2015 from 12.2% at the end of 2013, official figures show.

Zoljargal said the ongoing economic adjustment has created sufficient room for Mongolia to cope with its debt repayments. "Refinancing is one of the options," Zoljargal said. "But we are far away from a default."

Nevertheless, both the World Bank and Fitch said Mongolia faces "high" refinancing risks. Should they prove right, Mongolia may have only two options. One would be a bailout coordinated by the International Monetary Fund -- an IMF standby program was discussed earlier in 2015. The alternative would be additional financial support from China, which in 2014 expanded a currency swap line with the Bank of Mongolia to 15 billion yuan ($2.34 billion at current exchange rates) in 2014.

Both options would probably be better than a default, but either would drag Mongolia further from its dream of rapid economic growth fueled by a mining bonanza.