Namibia has a new president in the shape of Nangolo Mbumba just hours after, as vice-president, he had announced the death of his predecessor.
Hage Geingob, 82, died early on Sunday while receiving medical treatment at a hospital in the capital, Windhoek.
A veteran of the country's independence struggle, Mr Geingob had been diagnosed with cancer and revealed the details to the public last month.
The nation had lost a "liberation... icon", Mr Mbumba said.
He has since been sworn-in as Mr Geingob's replacement and will serve in the role until elections due later this year.
"I am not going to be around for the elections so don't panic," he said at a swiftly arranged swearing-in ceremony at state house, just 15 hours after the death of the president.
Paying tribute to his predecessor, he said "our nation remains calm and stable owing to the leadership of President Geingob who was the chief architect of the constitution".
"I take on this heavy mantle cognisant of the weight of responsibility."
Mr Geingob was first sworn-in as president in 2015, but had served in top political positions since independence in 1990.
The exact cause of his death was not given but last month he underwent "a two-day novel treatment for cancerous cells" in the US before flying back home on 31 January, his office had said.
On Namibian radio, people have been sharing memories of someone they described as a visionary as well as a jovial man, who was able to share a joke.
Leaders from around the world have been sending condolence messages with many talking about Mr Geingob's efforts to ensure his country's freedom.
Among them has been Cyril Ramaphosa, president of neighbouring South Africa, who described him as "a towering veteran of Namibia's liberation from colonialism and apartheid".
Mr Geingob, a tall man with a deep, gravelly voice and a commanding presence was a long-serving member of the Swapo party. It led the movement against apartheid South Africa, which had effectively annexed the country, then known as South West Africa, and introduced its system of legalised racism that excluded black people from political and economic power.
Mr Geingob lived in exile for 27 years, spending time in Botswana, the US and the UK, where he studied for a PhD in politics.
He came back to Namibia in 1989, a year before the country gained independence.
"Looking back, the journey of building a new Namibia has been worthwhile," he wrote on social media in 2020 while sharing a picture of him kissing the ground on his return.
"Even though we have made a lot of progress in developing our country, more work lies ahead to build an inclusive society."
When Mr Geingob first became president in 2015, he had already been the country's longest-serving prime minister - in the post for 12 years from 1990 and then again for a shorter stint in 2012.
But going by results at the ballot box, his popularity had declined.
In the 2014 election, he won a huge majority, taking 87% of the vote. But five years later that had fallen to 56%.
Mr Geingob's first term coincided with a stagnant economy and high levels of unemployment and poverty, according to the World Bank.
His party also faced a number of corruption scandals during his time in office. This included what became known as "fishrot", where ministers and top officials were accused of taking bribes in exchange for the awarding of lucrative fishing quotas.
By 2021, three-quarters of the population thought that the country was going in the wrong direction, a three-fold increase since 2014, according to independent polling organisation Afrobarometer.
Three decades after independence, the heroic narrative of Swapo having liberated the country was losing its appeal among a generation born after the event, long-time observer of Namibian politics Henning Melber wrote in 2021.
Swapo, in power since independence, had chosen Netumbo Nandi-Ndaitwah as its presidential candidate for November's planned elections.
She has now been appointed vice-president and will become the country's first female president if she wins.