Prime Minister Kassim Majaliwa last week on Friday blamed the narrative of the president's ailment on some "hateful" Tanzanians living abroad.
Tundu Lissu, Magufuli's main rival in the October election when the president won a second five-year term, had suggested Tanzania's leader had been flown to Kenya for treatment for COVID-19 and then moved to India in a coma.
After the death was announced, opposition leader Zitto Kabwe said he had spoken to Vice President Hassan to offer condolences for Magufuli's death.
"The nation will remember him for his contribution to the development of our country," Kabwe said in a statement published on Twitter.
According to Tanzania's Constitution, Vice President Hassan, 61, should assume the presidency for the remainder of the five-year term that Magufuli began serving last year after winning a second term. She would be the East African nation's first female president.
Born in the semi-autonomous archipelago of Zanzibar, Hassan studied economics in Britain, worked for the U.N.'s World Food Programme and then held various government posts prior to becoming Tanzania's first female vice president in 2015.
Hassan said Magufuli was admitted on March 6 to Jakaya Kikwete Cardiac Institute for heart problems and discharged the next day. A week later he felt bad and was rushed to Mzena hospital where he was getting treatment under supervision of doctors from the cardiac institute.
Nicknamed "The Bulldozer" because of his reputation for pushing through policies despite opposition, Magufuli frustrated the World Health Organization (WHO) during the pandemic by playing down the threat from COVID-19, saying god and remedies such as steam inhalation would protect Tanzanians.
The former chemistry teacher had mocked coronavirus tests, denounced vaccines as part of a Western conspiracy to take Africa's wealth, and opposed mask-wearing and social distancing.
Tanzania stopped reporting coronavirus data in May last year when it had reported 509 cases and 21 deaths, according to the WHO, which has urged the government to be more transparent.
He was re-elected for a second term in 2020, winning 84% of the vote in an election the opposition said was marred by irregularities and whose results it rejected.