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.
Mr Nkurunziza came to power in 2005 two years after the end of a 10-year civil war which left 300,000 people dead.
The former rebel leader took pride in the fact that his administration brought peace to Burundi.
But his government was criticised for widespread human rights abuses.
These included “extrajudicial executions, disappearances, arbitrary arrests, sexual violence, extortion, beatings, and intimidation”, according to Human Rights Watch.
Political opponents have been targeted and journalists have been imprisoned.
The government has announced seven days of national mourning. (Courtesy BBC)