John Magufuli was speaking to an applauding church congregation when he said: “God has answered your prayers.”
In the past he has accused health officials of exaggerating the crisis.
Tanzania does not have strict lockdown measures like those in other countries.
Large public gatherings have been banned and schools have been closed but videos of night burials shared on social media have caused some to call into question the government’s approach.
- Night burials amid Tanzania’s coronavirus defiance
- What African nations are doing to help people eat
- Why lockdowns may not be the answer in Africa
The World Health Organization has also expressed concern about the government’s strategy. The authorities have been slow to reveal official data.
Despite its warning on Wednesday that the chance of contracting the virus was “extremely high”, the US embassy did not provide details backing up its claim that hospitals in the commercial hub, Dar es Salaam, were struggling to cope.
Speaking at a church service in his hometown of Chato, north-west Tanzania, President Magufuli revealed that his own child had contracted the virus but was now well and “doing push-ups”.