He added that on Monday he had felt worse, which prompted him to take the coronavirus test.
Mr Bolsonaro is in a higher-risk group because of his age, 65.
He said he was taking hydroxychloroquine - championed by US President Donald Trump - and azithromycin, an antibiotic, to treat the illness. Neither has been proven to be effective against the virus.
Contact tracing and tests will be carried out for the people Mr Bolsonaro has met recently.
His previous three tests for the virus all came back negative.
The executive director of the World Health Organization, Dr Mike Ryan, wished President Bolsonaro "a speedy and full recovery from this disease", adding: "I think the message to us all is: we are vulnerable to this virus."
What had he previously said?
Back in April, Mr Bolsonaro said that even if infected, he would "not have to worry as I wouldn't feel anything, at most it would be like a little flu or a little cold".
The number of Covid-19-related deaths and infections - at that time under 3,000 and 40,000 - has since soared.
Despite this, President Bolsonaro has argued that regional lockdowns are having a more damaging effect than the virus itself, and accused the media of spreading panic and paranoia.
His other comments on the virus include:
- 11 March:"From what I have seen until now, there are other kinds of flu which have killed more people than that [coronavirus] one"
- 18 March: "Today we have information, that because we have a more tropical climate [in Brazil] we've almost reached the end [of the pandemic], or it's already over... the virus doesn't spread as fast in warm climates like ours"
- 20 March: "After being stabbed, I'm not going to be brought down by a little flu"
He has since continued to rail against measures that he deems "dictatorial" such as the closing beaches or requirements to wear face coverings.
On Monday, he made further changes to a law that would require Brazilians to wear masks in public.
He has attended a number of public events without a mask, even when local rules required him to wear one.
On Sunday, Foreign Minister Ernesto Araújo posted a photo on social media showing himself with President Bolsonaro and others attending an Independence Day celebration at the US embassy in Brasilia.
None of those in the photo is wearing a mask or observing social distancing.