The world’s youngest country, South Sudan, has endured terrible growing pains since gaining its independence in 2011. Racked by war and famine, it has remained in a near-constant state of humanitarian crisis.

A smooth independence was always unlikely to prove easy, steeped as it was in 50 years of fighting—often with the motivation of religious freedom in the mostly Christian south—against the hardline Islamist government to the north in Khartoum.

Yet as bad as the fallout of independence has been—tens of thousands of people killed and millions displaced—it might have been even worse were it not for the country’s Christian churches. Throughout decades of destruction and failed politics, the different denominations have displayed a level of inter-religious cooperation rarely seen elsewhere in the world, as priests and pastors bring humanitarian relief to civilians who have been failed by others.

Indeed, the churches have emerged as one of the country’s few stable institutions. This has enabled church leaders to effectively lobby the international community to support the southern cause while also brokering peace between communities torn apart by war and ethnic strife.

“The churches in South Sudan operate very ecumenically—this is rare worldwide,” says John Ashworth, who has worked in South Sudan and advised its churches for more than 30 years. “The churches as bodies have remained united in calling for an end to the killing, a peaceful resolution through dialogue, peace, and reconciliation, in some cases at great personal risk.”

Facing the same adversities, South Sudan’s Christian churches embraced an ecumenical approach to establish the South Sudan Council of Churches (SSCC) in 1990. This coalition spearheaded their joint efforts that proved heavily influential in the 2005 peace deal that ended Africa’s longest-running civil war.

The SSCC continued its involvement in the process that led to the January 2011 referendum on independence, in which an overwhelming majority of South Sudanese voted to secede and become Africa’s first new country since Eritrea split from Ethiopia in 1993. South Sudan formally gained its independence from Sudan on July 9, 2011.

But those achievements began to unravel in 2013 when government troops began massacring ethnic Nuer in the capital, Juba. Afterwards, the national army, called the Sudan People’s Liberation Army (SPLA), split along ethnic lines during a violent uprising, pitting ethnic Dinka loyal to President Salva Kiir against Nuer led by former vice president Riek Macher.

Both sides committed atrocities, and the narrative of fighting for religious freedom was manipulated for political advantage. The SPLA have painted themselves as Christian liberators—atrocities notwithstanding—their propaganda portraying the churchgoing President Kiir as the “Joshua” who took South Sudan to the promised land of independence.

“The blood of the tribe has become thicker than the blood of the Christ,” Episcopal Bishop Enock Tombe remarked in 2014.

Although Islam has dominated the region for centuries, Christian roots in Sudan and South Sudan go back to the 5th century. Missionaries were active into the 1800s, mainly from the Anglican, Presbyterian, Catholic, and Coptic churches.

Though there are conflicting reports about South Sudan’s exact religious composition, Christianity is the dominant faith. A 2012 Pew Research Center report estimated that around 60 percent of South Sudanese are Christians, 33 percent followers of African traditional religions, 6 percent Muslims, and the rest unaffiliated.

But the influence and constructive capability of church leaders has been tested by the latest bout of fighting.

“The current war has divided people along ethnic lines—the church is not immune to these divisions,” says Carol Berger, an anthropologist who specializes in South Sudan.

Earlier this year James Wani Igga, South Sudan’s current vice president, accused priests of promoting violence, while others have charged the church with inaction during the latest civil war.

Ashworth suggests that after the 2005 peace agreement, the SSCC “took a breather to rebuild and repair,” with the 2011 outbreak of war catching them unprepared and less capable. Consequently church leaders have taken longer than expected to rebuild their capacity, though the SSCC is now acting to make up for lost time.

The choosing of a new secretary general marked a good start, says Philip Winter, a South Sudan specialist who has long been engaged in its peace processes. He notes how the SSCC was called upon by the warring parties negotiating this year in Addis Ababa, the Ethiopian capital, to help them get over their differences—something the Intergovernmental Authority on Development (IGAD) had failed to do as a mediator.

“The SSCC recognized that is was perhaps not as effective as the most recent conflict required,” Winter says. “So they are once more playing an important, if discreet, role.”

It appears this may have borne fruit. At the beginning of August, the warring factions signed a power-sharing deal aimed at ending the civil war, now in its fifth year. The agreement will see rebel leader Machar return to government as one of five vice presidents.

Observers remain cautious though. Some note that the latest deal is essentially the same as the agreement signed in 2015, which collapsed after about a year, as Machar fled Juba on foot chased by helicopter gunships. They say there’s a lot more to peacemaking than signing a piece of paper.

To that end, the SSCC’s renewed impetus has included implementing a national Action Plan for Peace (APP), which recognizes the need for a long-term peace process to resolve not only the current conflict but also the unresolved effects of previous conflicts. The SSCC says the APP may continue for 10 or 20 years.

At this stage of the plan, the SSCC hopes to see a visit to the country by Pope Francis. Earlier this year, the pope met with a delegation of Christian leaders from South Sudan who urged him to visit.

The pope previously postponed a planned 2017 South Sudan trip with Justin Welby, the head of the Anglican Church. Most media assumed that decision was because the country was too dangerous to visit. But Welby told media the postponement was to ensure the visit would have the maximum impact on helping to establish peace.

“You’re playing a heavyweight card and you have to get the timing right,” Welby said. “You don’t waste a card like that on anything that is not going to work.”

Perhaps the moment to play the card has come as the latest peace deal hangs in the balance. Observers note that there are reasons for cautious optimism. This time around there is more impetus for peace: the people of South Sudan are fed up with the conflict, while elites on both sides have run out of money and know the country’s oil industry needs to operate to provide them with cash so they can stay in power.

Hence, politicians who have routinely placed their thirst for power before the welfare of the South Sudanese people may finally be willing to adhere to the ministrations of the country’s church leaders. Even if peace is secured, though, whether those same politicians can continue running the country remains another question.

“The churches are the only players left standing on the South Sudan stage who have any moral credibility and national recognition,” Winter says. And he appears to be right.

James Jeffrey is a freelance journalist who splits his time between the Horn of Africa, the U.S., and the UK, and writes for various international media. Follow him on Twitter @jrfjeffrey.