NAIROBI, Kenya — The recent death of a Catholic priest in the Central African Republic demonstrates the delicate nature of peace in the country, where a cardinal and an imam have worked to bring the population toward peace and unity.

Father Joseph Desire Angbabata, parish priest at St. Charles Lwanga Church in Seko in the southern Diocese of Bambari, died March 21 after he was shot during an attack at the parish.

Rebels shot the 48-year-old priest as he intervened to protect refugees camped at the church compound. Such attacks pose risks to Catholic clergy who step up to protect people forced to flee violence in the troubled country.

Two forces — the Christian-dominated Anti-Balaka and the rebel Seleka, led by Arab-speaking Islamists — have clashed in the mineral-rich area for years.

The attack on the parish occurred March 20 and lasted about 24 hours, leaving an unknown number of civilians dead. The victims were buried in a mass grave, according to reports.

Cardinal Dieudone Nzapalainga of Bangui joined Imam Omar Kobine Layama March 26 in denouncing the priest’s killing.

“We strongly condemn these acts. The men of God have the task of announcing the path of peace and reconciliation,” Fides News Agency quoted the two leaders as saying.

The two religious leaders have united to steer a fragile peace effort in the country, where Christians make up about 80 percent of the population and Muslims about 15 percent.

The country has experienced instability since 2013, when Seleka forces overthrew the government. French and African peacekeepers were deployed in January 2014 and drove the rebels from the capital, Bangui.

With a newly elected government unable to move beyond Bangui, armed groups and militias have taken control of more than 70 percent of the country.

Thousands of civilians have been uprooted from their homes, and now more than half of the population need humanitarian aid to survive. Some of the displaced civilians, including Muslims, found refuge in the St. Charles Lwanga Church compound.

The conflict is fueled by the desire to control access to key minerals for a variety of consumer products.

“We keep on repeating that the crisis in our country is an economic struggle about the exploitation of our natural resources,” Bishop Nestor-Desire Nongo-Aziagbia of Bossangao said in a recent interview.

The United Nations Multidimensional Integrated Stabilization Mission has been deployed in the country, but religious leaders are concerned those forces have failed to protect civilians from attacks by militias and armed groups.