Magufuli, a known Covid-19 skeptic, had been missing from public view for almost three weeks, fuelling rumours of his ill health, with opposition leaders claiming he had contracted the virus.
Tanzania's President John Magufuli has died aged 61, after more than five years of divisive, authoritarian rule capped by his refusal to take Covid-19 seriously.
Magufuli, popularly nicknamed the "Bulldozer", had been missing from public view for almost three weeks, fuelling wild rumours of his ill health, with opposition leaders claiming he had contracted the virus.
"It is with deep regret that I inform you that today on the 17th of March, 2021 at 6:00 pm we lost our brave leader, the President of the Republic of Tanzania, John Pombe Magufuli," said vice-president Samia Suluhu Hassan.
She said Magufuli had died of a "heart condition", which he has suffered from for a decade, at a hospital in Dar es Salaam.
He had first been briefly admitted to the Jakaya Kikwete Cardiac Institute on March 6, but was subsequently discharged, Hassan said.
But Magufuli had again felt unwell and was on March 14 rushed to hospital, this time to the Emilio Mzena Memorial Hospital in Dar es Salaam.
"Our country shall be in a mourning period of 14 days and the flags shall fly at half-mast," said Hassan, adding that funeral arrangements were under way.
Magufuli last appeared in public on February 27, and the fervent Catholic had missed three Sunday services, where he would often address the congregation, sparking concern.
Opposition leader Tundu Lissu cited sources saying that he had caught the virus, as demands grew for information on his whereabouts and rumours took off that Magufuli was seeking treatment outside the country.
Magufuli was first elected in 2015 as a corruption-busting man of the people, endearing him to a population weary of graft scandals.
However a slide into authoritarianism, which saw a crackdown on the media, civil society and opposition, raised alarm among foreign allies and rights groups.
His re-election last October was dismissed by the opposition and some diplomats as a sham, over alleged rigging, the blocking of foreign media and observer teams and an oppressive military presence.
Analysts said that Magufuli had dealt a crushing blow to democracy in one of Africa's most stable nations.
Magufuli also expanded free education, rural electrification and invested in infrastructure projects such as railways, a hydropower dam set to double electricity output and the revival of the national airline.
His government also passed a raft of laws to increase Tanzania's stake in its mineral resources and demanded millions of dollars in back taxes from foreign mining companies.
But it is his handling of the coronavirus pandemic which cast his leadership style into sharp relief.
He championed prayer instead of face masks, before stopping the publication of statistics in April 2020 when the country had recorded a total of 509 cases and 16 deaths.
Tanzania became an outlier in a region which quickly implemented lockdowns, nightime curfews and travel restrictions to stem infections.
In May last year he revealed he had submitted a variety of fruit and animals to be tested for the virus and that a papaya, quail and goat tested positive, revealing "sabotage" at the national laboratory.
'There is no Covid-19'
The devout Christian, who often took to the pulpit when he attended mass, later claimed prayer had saved the country from Covid-19.
"That's why we are all not wearing face masks here. You think we don't fear dying? It's because there is no Covid-19," he said.
However by February, under mounting pressure after the vice president of semi-autonomous Zanzibar was revealed to have died from the coronavirus, Magufuli appeared to concede the virus did in fact exist.
Under Tanzania's constitution, Hassan will become the country's first female president and will consult the ruling CCM party over the appointing of a new vice president.
His death plunges Tanzania into political certainly, said Nic Cheeseman, professor of democracy at the University of Birmingham.
"The news of Magufuli's death will fundamentally reshape Tanzanian politics. Having dominated the political scene since his election, he leaves something of a political vacuum," Cheeseman said.
"This will trigger fresh uncertainty and all eyes will be on internal CCM politics to see what deals have been struck in the ruling party about the balance of power after the transition."