Burundi's President Pierre Nkurunziza, aged 55, has died after suffering a cardiac arrest, the government says.
He was admitted to hospital on Saturday after feeling unwell, his condition improved but on Monday he had a cardiac arrest and efforts to revive him were unsuccessful, officials say.
After 15 years in power, Mr Nkurunziza was due to step down in August.
In 2015, the announcement that he would run for a third term plunged the country into chaos.
It sparked anger as some questioned the legality of a third-term bid.
There was a failed coup attempt, hundreds of people died in clashes and tens of thousands fled the country.
After a change in the constitution, he was able to run for a further term in last month's election but he decided to retire and was to be known as the "supreme guide to patriotism".
He was also due to receive a $540,000 (£440,000) retirement pay-out and a luxury villa.
Analysis: Loved and feared
By Samba Cyuzuzo, BBC Great Lakes
Pierre Nkurunziza was loved and feared in equal measure - loved by those who felt he lived up to his promises when he was elected after the civil war, and feared by his political opponents.
When the former rebel leader took office in 2005, at the age of 40, the country that had been brutally torn apart by an ethnic conflict that had killed about 300,000 over a decade.
Young, optimistic and charismatic, he managed to live up to everyone's expectations by uniting people and rebuilding the economy. Between 2006 and 2011, the president - known for his preaching and love of football - received seven international awards for his peace-building efforts.
But after a decade in power, his reputation took a nose dive and the unity he had built collapsed when he organised a referendum to allow him to stand for a third term. Deadly protests erupted, there was a coup attempt and hundreds of thousands of people fled the country.
After this he only left the country officially once - by car to neighbouring Tanzania. The UN accused him of oppressing the opposition and killing and abducting opponents, accusations vehemently denied by Burundi's government.
Despite suspicions that he planned to stay on for a fourth term, he did not stand in elections in May, which were held despite coronavirus.
He and his wife Denise, who had five children together and adopted several others, regularly organised prayer gatherings - and the man who was to become Burundi's "supreme guide to patriotism" put all his successes down to God, including what he said the country's success against Covid-19.
What happened to the president?
The official statement announcing the president's death said he was taken ill in the evening after helping out at a volleyball match in Ngozi, northern Burundi, on Saturday.
He went to hospital, but appeared to be recovering on Sunday and was able to communicate with the people surrounding him, the government says.
His condition, however, rapidly changed on Monday.
What was his role in the civil war?
Before the civil war, Mr Nkurunziza, who had graduated in sports education, was a teacher and assistant lecturer at the University of Burundi.
He survived the killings of 1993 when ethnic Hutus were targeted at the university and joined the Forces for the Defence of Democracy (FDD) rebel group.
He emerged as its leader and after the 2003 peace deal, Mr Nkurunziza was named minister of interior before parliament elected him president in August 2005.
You may also be interested in:
Outside of politics, he was well known for his love of football. At one time he was the coach of the army football team and as president had his own side - Hallelujah FC.
Since last week, Mr Nkurunziza's wife, Denise Nkurunziza, has been receiving medical treatment in Kenya.
She was rumoured to have tested positive for coronavirus - a disease Mr Nkurunziza had appeared to downplay, holding an election in the midst of the outbreak, and even expelling World Health Organization representatives from the country.
The government has announced seven days of national mourning.
According to the constitution, if the head of state dies in office then the president of the national assembly, currently Pascal Nyabenda, should succeed him.
The winner of May's presidential election, Evariste Ndayishimiye, is due to be sworn in as president in August.