Department of international relations and cooperation spokesperson Nelson Kgwete confirmed eight South Africans died in Afghanistan on Tuesday but said few details were known.
"The men worked for a private aviation company. They died this morning in an explosion in Kabul. The department is working with the authorities through its mission based in Islamabad in Pakistan to establish more details about this," he said.
South Africa does not have an embassy in Afghanistan, so consular work in the area is handled by the mission in Pakistan.
Kgewte said the department had just received the names of the deceased and was working on establishing contact with the next of kin.
"We wish to express sincere condolences to the families. The necessary assistance will be rendered to the family and friends," he said.
The militants said the attack was in retaliation against a film mocking the Prophet Muhammad, made with private funds in the US and posted on the internet. It has ignited days of demonstrations in the Arab world, Africa, Asia and in some Western countries.
In a torrent of violence blamed on the film last week, the US ambassador to Libya and three other Americans were killed in an attack in Benghazi and US and other foreign embassies were stormed in cities in Asia, Africa and the Middle East by furious Muslims. At least nine other people were killed.
On Tuesday, a suicide bomber blew up a minivan near the airport in the Afghan capital and a spokesperson for the Hezb-e-Islami insurgent group claimed responsibility.
"A woman wearing a suicide vest blew herself up in response to the anti-Islam video," said militant spokesperson Zubair Sediqqi.
The claim will raise fears that anger over the film will feed into deteriorating security as the US and other Western countries try to protect their forces from a rash of so-called insider attacks by Afghan colleagues.
Worst outbreak of violence
Thousands of protesters clashed with police in Kabul the previous day, burning cars and hurling rocks at security forces in the worst outbreak of violence since February rioting over the inadvertent burning of Korans by US soldiers.
The protesters in Kabul and several other Asian cities have vented their fury over the film at the US, blaming it for what they see as an attack on Islam.
The outcry saddles US President Barack Obama with an unexpected foreign policy headache as he campaigns for re-election in November, even though his administration has condemned the film as reprehensible and disgusting.
In response to the violence in Benghazi and elsewhere last week, the US has sent ships, extra troops and special forces to protect US interests and citizens in the Middle East, while a number of its embassies have evacuated staff and are on high alert for trouble.
Despite Obama's efforts early in his tenure to improve relations with the Arab and Muslim world, the violence adds to a host of problems including the continued US military involvement in Afghanistan, Iran's nuclear programme, the Syrian civil war and the fall-out from the Arab Spring revolts.
The renewed protests on Monday dashed any hopes that the furore over the film might fade despite an appeal over the weekend from the senior cleric in Saudi Arabia, home to Islam's holiest shrines, for calm.
Afghan police said among the 12 dead in the Kabul bomb attack were Russians and South Africans working for a foreign company.
It followed a bloody weekend during which six members of Afghanistan's Nato-led alliance, including four Americans, were killed in suspected insider attacks carried out by Afghans turning on their allies.
Protesters also took to the streets in Pakistan and Indonesia on Monday and thousands also marched in Beirut, where a Hezbollah leader accused US spy agencies of being behind events that have unleashed a wave of anti-Western sentiment in the Muslim and Arab world.
Authorities in Bangladesh have blocked the YouTube website indefinitely to stop people seeing the video. Pakistan and Afghanistan have also blocked the site.
Iran has condemned the film as offensive and vowed to pursue those responsible for making it. Iranian officials have demanded the US apologise to Muslims, saying the film is only the latest in a series of Western insults aimed at Islam's holy figures.
The identity of those directly responsible for the film remains unclear. Clips posted online since July have been attributed to a man named Sam Bacile, which two people connected with the film have said was probably an alias.
Nakoula Basseley Nakoula (55) a Coptic Christian widely linked to the film in media reports, was questioned in California on Saturday by US authorities investigating possible violations of his probation for a bank fraud conviction. – Additional reporting by Reuters