* Groups have attacked shops mainly owned by African migrants
* African leaders have called on Ramaphosa to take action
* Female students restrained trying to storm conference centre
CAPE TOWN, Sept 4 (Reuters) - South African President Cyril Ramaphosa told officials and business leaders on Wednesday that he was committed to quelling attacks on foreigners that have threatened to cast a cloud over an economic forum aimed at boosting intra-African trade.
Police have arrested dozens of people and confirmed several deaths after riots in Johannesburg and the capital Pretoria in recent days, when roving groups attacked shops mainly owned by migrants from the rest of Africa.
It is unclear what ignited the latest round of violence, but analysts say contributing factors include high unemployment and frustration with limited economic opportunities.
South African grocer Shoprite Holdings said on Wednesday several stores in its home market, Nigeria and Zambia were closed and extensive damage had been done to several supermarkets over the past 24 hours.
The wave of unrest has kindled memories of previous deadly attacks on foreigners and strained diplomatic relations with Africa’s other economic powerhouse Nigeria, where reprisals on South African businesses have started. The shops were attacked after days of riots in South Africa chiefly targeting foreign-owned, including Nigerian, businesses.
Other African countries from Ghana to Ethiopia and regional bloc the African Union have called on Ramaphosa to take decisive action. Artists and ordinary citizens from across the continent have taken to social media to voice their anger, with some threatening retaliation.
"Taking action against people from other nations is not justified and should never be allowed in our beautiful country. … We need to quell those incidents of unrest," Ramaphosa told an event on the sidelines of the World Economic Forum’s (WEF) Africa three-day summit starting on Wednesday.
“South Africa must be a country where everyone feels safe, including women and foreign nationals,” Ramaphosa said, also condemning recent incidents where women had been killed.
Hundreds of mainly female students protesting about violence against women tried to storm the conference centre in Cape Town where the WEF conference was being held, but they were restrained by a heavy police presence.
The protesters shouted slogans like “We want justice” and sang songs from the struggle against apartheid while conference delegates peered through the glass to watch the spectacle. (Reporting by Alexander Winning and Wendell Roelf in Cape Town; Additional reporting by Nqobile Dludla in Johannesburg and other Reuters reporters in Africa; Editing by Alison Williams)