HARARE, Zimbabwe (AP) — Namibia's president and founding prime minister Hage Geingob died Sunday at age 82 while receiving treatment for cancer, and the southern African nation quickly swore in his deputy to complete the remaining time in office.

Geingob played a central role in what has become one of Africa's most stable democracies after returning from a long exile in Botswana and the United States as an anti-apartheid activist. He was the country’s third president since it gained independence in 1990 following more than a century of German and then apartheid South African rule.

He had been president since 2015 and was set to finish his second and final term in office this year. His deputy, Vice President Nangolo Mbumba, was sworn in as acting president in the capital, Windhoek, to complete the term as allowed by the constitution.

Elections are set for November. A government statement said Mbumba will lead Namibia until Mar. 21 of next year, when the winner takes office.

The presidential office said Geingob died in a local hospital with his family by his side. He had returned to Namibia last month from the United States, where he underwent a trial two-day “novel treatment for cancerous cells,” according to his office. In 2014, he said he had survived prostate cancer.

Soft-spoken but firm on advancing Africa’s agenda as an important stakeholder in world affairs, Geingob maintained close relations with the U.S. and other Western countries but also, like many African leaders, forged a warm relationship with China and other powers.

Russian President Vladimir Putin was among the leaders who sent condolences Sunday, saying he would “forever cherish” his memories of meeting Geingob. “It is difficult to overestimate his personal contribution to developing friendly relations between Namibia and Russia," a statement said.

Namibia, with just over 2.5 million people, is rich in minerals such as diamonds, gold and uranium. Despite being classified as an upper-middle-income country, socioeconomic inequalities are still widespread, according to the World Bank.

The nation on the southwestern coast of Africa enjoys political and economic stability in a region that has long seen conflict and disputed elections. Namibia's opposition criticized Geingob last year for endorsing disputed elections in Zimbabwe.

Geingob, who was Namibia’s first prime minister from 1990 to 2002 and served in the same capacity from 2008 to 2012, could be outspoken on issues at home and abroad. In January, he criticized former colonial master Germany for supporting Israel after South Africa filed a case against Israel at the International Court of Justice accusing it of genocide against Palestinians in Gaza.

“Germany cannot morally express commitment to the United Nations convention against genocide, including atonement for the genocide in Namibia, whilst supporting the equivalent of a holocaust and genocide in Gaza,” Geingob said.

He was referring to events between 1904 and 1908 when colonial security forces in Namibia killed tens of thousands of people while putting down an uprising. Germany in 2021 acknowledged that the actions amounted to genocide and pledged more than $1 billion for infrastructure projects in the country.

Condolences from African leaders poured in on Sunday.

South African President Cyril Ramaphosa described Geingob as “a towering veteran of Namibia’s liberation from colonialism and apartheid.”

Kenyan President William Ruto said Geingob “strongly promoted the continent’s voice and visibility at the global arena.”

Zimbabwe's President Emmerson Mnangagwa posted on X that Geingob’s “leadership and resilience will be remembered.”

Copyright 2024 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without permission.