Samia Suluhu Hassan said in a state TV address that Mr Magufuli died from heart complications at a hospital in Dar es Salaam, about 434 km (270 miles) east of the capital Dodoma.
“It is with deep regret that I inform you that today... we lost our brave leader, the president of the Republic of Tanzania, John Pombe Magufuli,” Ms Hassan added.
Mr Magufuli was last seen in public at an event in Dar es Salaam on 27 February by an opposition leader who urged the government to tell the public about the president’s alleged condition, saying citizens had the right to know about his health.
Some Tanzanians told Reuters on condition of anonymity that fear and anxiety had been widespread in the country due to the unknown status of the president.
Over the weekend, police arrested four people for allegedly spreading false information about the sickness of political leaders.
Nicknamed “The Bulldozer,” Mr Magufuli was a former chemistry professor from the village of Chato in northwest Tanzania, who rose up the political ladder quickly after winning a parliament seat in 1995.
Elected president in 2015, he had been accused by western countries and opposition parties of eroding democracy, which he denied.
Mr Magufuli was elected for a second term in 2020 amid opposition accusations of fraud and intimidation.
He was an active Covid sceptic and denounced measures to stop the spread of the virus and labelled vaccines as a western conspiracy.
Mr Hassan said there would be 14 days of national mourning and flags would fly at half-mast to mark Mr Magufuli's death.
Additional reporting by agencies
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies