JUBA, SOUTH SUDAN — The purpose of capital cities is usually to showcase their nations. By this standard, undeveloped Juba, in South Sudan, illustrates the daunting challenges that face the world’s newest and poorest nation.

Gaining independence in July 2011, South Sudan’s birth was not auspicious. Sudan was the largest country geographically in Africa, with significant ethnic, tribal, and religious differences between north to south. Hopes for a liberal, prosperous future died in 1989 when General Omar al-Bashir seized power from the democratically elected government, which had begun negotiating with rebels in the south. His rule, only recently ended, was marked by decades of repression and war.

Fighting was particularly bitter in the south. Estimates of the dead and displaced stand at two million and four million, respectively. (Separate conflicts in Darfur, the Blue Nile, and the Nuba Mountains also resulted in significant casualties.)

Under international pressure and in expectation of sanctions relief from the United States, al-Bashir negotiated an end to the civil war in the south in 2005. Secession won overwhelming support in the referendum that followed, leading to independence for South Sudan in 2011.

But in December 2013, President Salva Kiir Mayardit claimed that Vice President Riek Machar Teny Dhurgon had attempted a coup. Machar denied the charge and fled; soon fighting erupted between competing factions of the Sudan People’s Liberation Movement. The combat lines are heavily, but not completely, ethnic. Several abortive ceasefires followed, with a power-sharing agreement signed in August 2015. Unfortunately, it quickly broke down, and was followed by renewed fighting and a split in Machar’s faction. A fresh peace accord was agreed to last year and suffered the usual delays. Now a new coalition is supposed to take power in November.

The consequences of all this have been catastrophic: in a nation of 12 million, perhaps 400,000 have been killed, 4.3 million have been displaced, and even more face famine. Incomes and living standards have collapsed. Civil war typically does not make for a prosperous or free society, and the desperate need for economic development is evident in Juba. Most side streets are dirt; many are deeply furrowed from rain and wear. Simple shops and homes—often shacks and even tents—line streets and fill neighborhoods.

Government ministries are scattered about, most housed in basic facilities. There are some more modern buildings, and members of a well-connected, successful commercial class, along with abundant expatriates, live better. Nevertheless, the financial needs even in the capital are vast. And poverty is even deeper in the more populous countryside.

South Sudan’s greatest opportunity, and bane, may be oil. Like so many other poor nations, resource revenues offer an extraordinary honey pot that does as much to corrupt and disable as enrich and empower. Great is the necessity of freeing South Sudan’s limited economy. The country is not even ranked by the Economic Freedom of the World and Index of Economic Freedom reviews. Yet there isn’t much that can be done economically while South Sudan struggles to escape from civil war.

Equally problematic is the political system, which has also suffered from the descent into violent chaos. Freedom House rates the country as “unfree,” at the bottom in terms of political rights and civil liberties. The “civil war has stifled ordinary politics and created a climate of fear,” the group explains, while elites “have presided over rampant corruption, economic collapse, and atrocities against civilians, journalists, and aid workers.” Human Rights Watch notes, “All parties to the conflict committed serious abuse, including indiscriminate attacks against civilians including aid workers, unlawful killings, beatings, arbitrary detentions, torture, sexual violence, recruitment and use of child soldiers, looting and destruction of civilian property.”

The State Department was no more positive in its assessment, emphasizing that the problems go beyond the government. Notes their report: “Opposition forces also perpetrated serious human rights abuses, which, according to the United Nations, included unlawful killings, abductions, rape, sexual slavery, and forced recruitment.”

Such abuses are not evident to a visitor to Juba, which is stable, if heavily patrolled by armed security personnel. More serious problems occur in conflict areas. Thankfully, the worst of the fighting is in abeyance. The latest ceasefire and power-sharing agreement—there have been many over the years—appear to be holding.

Yet few believe there is sufficient time to build a coalition government and integrate rebel forces into the army before the November deadline. When I was in Juba, Kiir met with his former deputy Machar for the first time since April. Opposition representative Henry Odwar reported: “We touched on issues of constitutional amendment, the draft that is going to be presented to the parliament and we also discussed the few security laws. We also talked about the issue of non-signatory parties.” Few specifics were decided, though the two leaders reaffirmed their commitment to create a transitional administration within two months.

Much could go wrong. Journalist Julian Hattem warned that the peace is fragile: “Key provisions of the agreement about demobilizing fighters and redrawing internal political lines remain unfulfilled. There are mounting fears that the deal’s eventual breakdown could lead to a return to large-scale violence in South Sudan.” Still, neither side appears to desire a return to arms.

Equally significant was the meeting, which also took place while I was in town, between Kiir and Sudanese Prime Minister Aballa Hamdok. Apparently they reaffirmed their nations’ dual commitment to stop meddling in each other’s political disputes and military conflicts. Khartoum once supported Machar, though it eventually backed off, and Bashir’s overthrow shifted power toward civilians concerned more with improving living standards than playing geopolitical games. South Sudan had reciprocated, once aiding insurgents battling Khartoum, later dropping its support. Such mutual forbearance improves chances for peace and stability.

However, the situation is greatly complicated by additional opposition figures, most importantly one-time Kiir ally Thomas Cirillo of the Opposition Alliance. Kiir and Machar do not speak for them; indeed, sporadic clashes involving other forces continue around the country. Giving everyone a stake in the political process remains a challenge. It’s difficult to turn warlords into politicians, as Afghanistan has demonstrated.

Warned the International Crisis Group last year, the peace accord “does not end the country’s deep crisis. It neither resolves the power struggle between President Salva Kiir and erstwhile rebel leader Riek Machar nor outlines a final political settlement for the country. Rather, it establishes a wobbly Kiir-Machar truce and grafts it onto the previous failed peace terms without delivering much benefit to other groups that have been shut out of power. The new deal has lessened fighting, a welcome outcome, but it could break down over any number of outstanding disputes.” Getting this far has required intensive international involvement, especially by other African states; it will likely take even more to successfully implement the agreement.

Westerners can help prepare the South Sudanese for nationhood, but the country’s future is in its own people’s hands. I visited South Sudan with the group Hardwired, founded by Tina Ramirez, a former congressional aide. Hardwired emphasizes building understanding and support for religious tolerance and liberty. It has been active around the world in such varied locations as Kurdistan and Nigeria. One of Hardwired’s objectives, including in South Sudan, is teachers, who help prepare the next generation.

In Juba, Hardwired also taught a seminar on the rule of law and constitutional reform, in which I participated. The forum attracted judges, lawyers, journalists, pastors, political activists, and educators, all determined to achieve a more peaceful and prosperous future. The South Sudanese people are ready to lead, if they’re allowed to do so by their government.

Although the people I met are hopeful, the closer the power-sharing arrangement comes to fruition, the greater is the danger of violent collapse. Integrating former combatants into a single military will be difficult. Moreover, warned ICG, “the looming specter of elections can raise tensions and trigger conflict—as it did in 2013 when polls were planned for 2015. The risk is particularly acute if the two parties share armed control of the capital, as they did in 2016.” Then problems in ensuring security for the leaders of contending factions led to the agreement’s collapse. The people of South Sudan cannot afford another such failure.

The experience offers U.S. policymakers a sobering lesson about international social engineering. Bashir’s Sudan became a “project” in Washington, attracting everyone from Hollywood celebrities to evangelical activists. Yet insisting on political change for which local peoples were not ready proved disastrous. After the new nation fell into civil war, Washington was largely powerless to end the horror that it had helped set in motion.

Like so many other nations in conflict, South Sudan is filled with good people suffering through bad, even catastrophic, events. Enabling them to take control of their futures is the essential challenge.