(Reuters) - South Africa remains committed to maintaining friendly relations with Nigeria after Abuja recalled its ambassador to Pretoria in the wake of attacks on immigrants, the department of international relations said on Sunday.

Acting High Commissioner Martin Cobham and Deputy High Commissioner Uche Ajulu-Okeke were asked to return to Nigeria for consultations in the latest sign of African countries' discontent over South Africa's handling of attacks on foreigners.

At least seven people have been killed over the last month in a wave of anti-immigrant violence centred on areas of Durban and Johannesburg.

South Africa has been criticised by several governments, including China, Nigeria and Zimbabwe, for failing to protect foreigners from armed mobs. Nigeria is the only country to have recalled its ambassador, the department of international relations said in a statement.

"If this action is based on the incidents of attacks on foreign nationals in some parts of our country, it would be curious for a sisterly country to want to exploit such a painful episode for whatever agenda," the department said.

"South Africa remains committed to a strong bond of friendship and bilateral relations with Nigeria," it added.

The department also said Pretoria would raise its concerns with Nigeria's new administration when it assumes office next month.

South Africa deployed troops last week to hotspots in the two cities to try to quell the violence.

(Reporting by Olivia Kumwenda-Mtambo; Editing by Rosalind Russell)