By JEROME DELAY, NQOBILE NTSHANGASE and THEMBA HADEBE, Associated Press

JOHANNESBURG (AP) — A shaken South Africa on Friday announced its first two deaths from the coronavirus as the country's cases rose above 1,000 and a three-week lockdown began, with some police screaming at the homeless on emptying streets.

The health minister said the deaths occurred in Western Cape province, home of Cape Town. South Africa has the most virus cases in Africa, with the total across the continent now above 3,200.

Security forces with megaphones screamed at people shortly after midnight in downtown Johannesburg, the country’s commercial hub. Homeless people scattered, looking for places to shelter, to the astonishment of residents who lined up on balconies and filmed the patrols with their mobile phones. One baton-wielding officer took chase.

Some motorists were pursued, stopped and searched. “Go home," security forces shouted. “You cannot be outside ... You are so selfish.” Around 3 a.m., sustained gunfire echoed through the streets.

South Africa’s military helped to enforce measures that include bans on sales of cigarettes and alcohol, even dog-walking. After daybreak, police and military forces again surrounded a few dozen homeless people in downtown Johannesburg close to the main train station.

The risk of abuses was a concern. In Rwanda, which imposed a lockdown over the weekend, police have denied that two people shot dead on Monday were killed for defying the new measures.

South African President Cyril Ramaphosa, in full military uniform, on the eve of the lockdown told troops to be a “force of kindness” and reminded police that “our people are terrified right now and we should not do anything to make their situation worse.”

People are meant to go outside only to obtain essentials such as groceries or medical care or to provide essential services. Public transport operates only during the usual rush hours, but complaints were reported of being charged double the price.

"We are putting our lives at risk," one commuting worker, Simphiwe Radebe, told The Associated Press, saying they had little choice. "Please pray for us that are still working." Minibus taxis were sprayed with disinfectant before passengers boarded, leaving spaces between them, some wiping their hands.

Some shoppers ignored calls to keep at least a meter apart, jostling, as about 200 lined up outside a center in Vosloorus, a township east of Johannesburg.

Some people were openly scared. One caller to a popular morning radio talk show dissolved into tears: “I feel there's nothing we can do,” he said.

Anxiety has been especially high among low-income South Africans squeezed into crowded townships with limited water supplies, sometimes with an extended family sharing a shack of corrugated metal and little income. Fears of an increase in domestic violence and rape have been expressed by civil society groups.

Economic pain is widespread, with the country already in recession and unemployment at 29%.

In Africa's largest city, Nigeria's Lagos, traders also worried after nonessential markets were shut down and the country's cases rose to 65. “If we do not go out, we cannot eat, our government did not make any provision for us,” Bolaji Tajudeen said.

Elsewhere in Africa, the United Nations mission in Somalia said a contractor had the virus, bringing cases in that fragile country to three. Somalia's health ministry said the person was in the international compound at the Mogadishu airport, where many diplomats and aid workers are based.

For most people, the new coronavirus causes mild or moderate symptoms, such as fever and cough that clear up in two to three weeks. For some, especially older adults and people with existing health problems, it can cause more severe illness, including pneumonia and death.

More lockdowns are expected. Twenty-four of Africa's 54 countries already have fully closed borders, according to the Africa Centers for Disease Control and Prevention.

"It is a literally a matter of life and death," Botswana President Mokgweetsi Masisi said Friday, urging citizens to stay home. The country is just one of eight in Africa without a confirmed case. “Our actions will determine whether we survive this pandemic or not.”

___

Lekan Oyekanmi in Lagos, Nigeria contributed.

___

Follow AP coverage of the virus outbreak at https://apnews.com/VirusOutbreak and https://apnews.com/UnderstandingtheOutbreak