The Commissioner for Health in Lagos state said healthcare workers, as well as people in close contact with someone with the virus, would be either given chloroquine or a placebo.
A second trial is to be launched in partnership with the World Health Organization (WHO).
Officials say results should be known within two months.
US President Donald Trump caused controversy earlier this week when he told reporters he had been taking another anti-malarial drug - hydroxychloroquine - despite warnings it might be unsafe.
While the trials are taking place in a controlled clinical environment, the WHO has warned that some individuals are self-medicating and risk causing themselves serious harm.
Chloroquine has not yet been shown to be safe and effective in the prevention or treatment of coronavirus and can cause dangerous heart arrhythmias.
Lagos Health Commissioner Prof Akin Abayomi also said the government was trying to transition to home-based isolation, admitting that some patients who tested positive for the virus were absconding and reluctant to be admitted to isolation units.