The small central African country of Burundi is approaching its 17th month of violence sparked by President Pierre Nkurunziza’s decision to seek a third term in office.

Once a relative success story, Burundi’s democracy is now on life support. Its plight is a reminder of the fragile state of African democracy, and is part of an unfortunate trend across the continent that threatens American interests and the hard-earned freedoms of millions of Africans.

In 2005, the Burundian Parliament elected Nkurunziza president, a hopeful sign for a country emerging from 12 years of genocidal civil war that only ended in 2006. However, his April 2015 decision to seek a third term in office—a move the opposition claimed contravened a constitutional limit of two terms—provoked widespread protests.

Burundian security services and a youth militia allied with the ruling party responded violently to the demonstrations. Nkurunziza was eventually elected in July 2015, and a rebel group took up arms to attack the regime. Elements of the military also launched a failed coup in May 2015.

Anywhere from approximately 500 to 900 people have died during the unrest, and roughly a quarter million people have fled the country.

The government has allegedly detained at least 5,000 people, and a recent report documented Burundian intelligence services’ torture of anti-government activists. The rebels, meanwhile, have attacked military compounds, the police, and sympathizers and members of the regime in efforts to topple Nkurunziza.

Beginning in the early 1990s, many African countries made significant progress toward democracy. The disintegration of the Soviet Union helped discredit authoritarian rule in the eyes of many Africans. It also left a number of regimes without their primary sponsor, making it harder for them to ignore their peoples’ demands.

Struggling African economies also increasingly turned to the International Monetary Fund, World Bank, and developed nations for foreign aid, which was often linked with reforms promoting more democratic political systems.

The resulting democratic progress was heartening. Before 1990, only six of the 53 African countries had constitutional provisions for term limits. During the next decade, 48 new constitutions were promulgated, 33 of which had presidential term limits.

However, the democratic project on the continent is under threat. In the last seven years, leaders in Ethiopia, Uganda, and Kenya, among others, adopted laws designed to gut civil society. The same leaders have also used laws ostensibly designed to fight terrorism as a pretext to gag the political opposition.

Since 2001, 13 countries successfully passed constitutional referendums to extend or completely eliminate presidential term limits.

There is still hope for the future of democracy in Africa, however. The Heritage Foundation’s 2016 Index of Economic Freedom finds a positive correlation between economic freedom and democratic governance. Economic freedom in sub-Saharan Africa has, on average, ticked up over the last six years, suggesting democracy maintains a strong foothold on the continent.

Polling shows that citizens of most African countries prefer democracy as a governance system as well, and are willing to assert themselves for it.

In 2014, popular demonstrations forced the long-time ruler of Burkina Faso, Blaise Compaoré, to abandon plans to extend his time in office. Protests under the #ThisFlag banner are ongoing against the sclerotic and abusive regime in Zimbabwe, as are massive protests by the marginalized Oromo population against the oppressive Ethiopian government.

There have been other bright spots as well. The Central African Republic voted in December to reduce presidential term limits to two terms, and Senegal passed an amendment that will shorten the presidential term from seven to five years. Newly elected President Patrice Talon of Benin ran on the promise of reducing executive power, while Nigeria’s 2015 election featured—for the first time in the country’s history—an incumbent president peacefully stepping down after electoral defeat.

Democracy is ebbing in too many African countries. Heads of state are using a variety of stratagems to prolong their stays in power, which will inevitably stifle civil society and the institutions needed to guarantee sustainable democracy.

Yet some countries have also passed important reforms, while thousands of Africans across the continent are challenging some of the most repressive regimes in Africa. There is hope yet that the anti-democratic trend on the continent can be beaten back.