Tanzania's Samia Suluhu Hassan sworn in as first female president
The 61-year-old, dressed in black suit and red headscarf, took the oath of office in Dar es Salaam before inspecting troops at a military parade and receiving a cannon salute.
Under the constitution, Hassan will serve the remainder of Magufuli's second five-year term, which does not expire until 2025.
Hailing from Zanzibar, the semi-autonomous island in the Indian Ocean, Hassan rose through the ranks over a 20-year political career from local government to the national assembly.
A stalwart in the ruling Chama Cha Mapinduzi (CCM), she was named Magufuli's running mate in the 2015 presidential campaign.
The pair were re-elected in October last year in a disputed poll marred by allegations of irregularities.
She must consult the party about appointing a new vice president. Analysts say she could face pressure from powerful Magufuli allies within the CCM, who dominate intelligence and other critical aspects of government, and could try and influence her decisions.
Hassan was little known outside Tanzania until she appeared on state television on Wednesday night to announce that Magufuli had died aged 61 from a heart condition after a mysterious three-week absence from public view.
Questions remain over the true cause of his death, after multiple rumours he had Covid-19 or had sought treatment abroad.