State house released the photos, but did not reveal why Janet Magufuli was in hospital.
BBC Swahili reports that this is the same hospital in Dar es Salaam that President John Magufuli made a surprise visit to after he won the presidential election.
Afterwards he sacked the boss of the hospital after finding patients sleeping on the floor.
Mrs Magufuli said the hospital had improved and that she had “also received good care from the doctors and nurses”.
Her husband visited other patients while he was at the hospital.
African leaders and their families often seek treatment in private hospitals or care overseas.
BBC