South African security forces have begun enforcing a three-week nationwide lockdown in an effort to stem the spread of the coronavirus.
All but essential movement is forbidden and both the army and the police are enforcing the measures.
Ahead of the midnight deadline there were long queues outside supermarkets as people stocked up on essentials.
South Africa has reported 927 coronavirus infections – the highest in Africa – but so far no deaths.
Late on Thursday, President Cyril Ramaphosa visited soldiers before they were deployed from a base in the Soweto township of Johannesburg.
“I send you out to go and defend our people against coronavirus,” he said, wearing a camouflage uniform.
“This is unprecedented, not only in our democracy but also in the history of our country, that we will have a lockdown for 21 days to go out and wage war against an invisible enemy, coronavirus.”
Food shops are allowed to stay open although alcohol sales are banned – Police Minister Bheki Cele urged South Africans to stay sober during the lockdown. Jogging and dog walking are also prohibited.
On Thursday, heavy traffic was reported on the main roads out of Johannesburg, despite a government appeal not to go on long journeys.
Thousands of people thronged bus stations aiming to escape the capital and stay with family in rural areas, raising fears that they could take the virus to older relatives who are retired in farms and villages.
The authorities have warned that anyone violating the rules faces six months’ imprisonment or a heavy fine.
“If people are not complying, they (the military) may be forced to take extraordinary measures,” Defence Minister Nosiviwe Mapisa-Nqakula warned.
South Africa has already closed schools and banned gatherings of more than 100 people.
Although Africa as a whole has not been hit as hard as other parts of the world by the virus, experts fear underfunded health services on the continent could be quickly overwhelmed by a sudden rise in cases.
In South Africa there are additional fears for people living with HIV – particularly the estimated 2.5 million in South Africa who are not taking anti-retroviral drugs.