NAIROBI, Kenya — Former Tanzanian President Benjamin William Mkapa, a Catholic who led several regional peace mediation efforts, died July 24. He was 81.

Tanzanian President John Pombe Magufuli said Mkapa had been undergoing treatment at a hospital in Dar es Salaam, where he died. Magufuli urged the people to remain calm, united and peaceful as they mourned their former president, who served from 1995 to 2005.

Mkapa was Tanzania’s third president. He was born in Ndanda in 1938. He was educated in Catholic schools, graduating from high school at St. Francis College in 1956.

After he graduated from Makerere University in Kampala, Uganda, with a degree in English in 1962, he earned a master’s degree in international studies at Columbia University in New York. He held several Cabinet posts — including foreign minister and information minister — and also served as Tanzania’s ambassador to the United States for three months in 1983.

“Our retired president, rest in peace,” said Auxiliary Bishop Method Kilaini of Bukoba. “You have fought a good fight and you have won the race.”

Mkapa is credited for introducing economic reforms after opening the country to foreign investors. He boosted tax collection and introduced strict measures to curb corruption, measures that led the International Monetary Fund and the World Bank to cancel Tanzania’s debt.

In retirement, Mkapa become a key peace mediator in the East African region. His latest effort was an attempt to mediate peace in Burundi, where a controversial election triggered a crisis in 2015.

Mkapa is survived by his wife, Anna, and two sons.

The country will mourn for seven days, a period during which all flags will fly at half-staff.