Thuli Madonsela, who helped write South Africa’s post-apartheid constitution and made her name as a fearless public protector, calls it a “reckless and dangerous dirty tricks campaign”. The journalist Max du Preez, who exposed apartheid’s death squads, describes a knife being thrust into an old wound. Jonathan Jansen, a respected voice on race relations, sees “despair and distress” cast on a fragile democracy still struggling with apartheid’s legacy.

Following reports of a campaign that allegedly exploited racial divisions to deflect attention from a business family’s troubles, South Africa – a nation admired around the globe for its ability to forgive – is not in a magnanimous mood.

One source of the public anger is familiar: the Gupta family, which has accumulated vast wealth and influence and has close relations with President Jacob Zuma. The other was until recently unknown to most South Africans: the British PR firm Bell Pottinger, which was co-founded by Margaret Thatcher’s former adviser Lord Bell (who left the company last year). On 6 July, Bell Pottinger announced that it had fired one of its partners and issued a rare apology for the work it did until April for the Guptas.

The story begins in early 2016, when the family signed a contract with Bell Pottinger, whose previous clients include the repressive governments of Egypt and Bahrain, the Pinochet Foundation and Trafigura, the commodity firm involved in a waste-dumping scandal in Côte d’Ivoire. Unverified correspondence leaked to the media suggests that President Zuma’s son, Duduzane, who is in business with the Guptas, was involved in brokering the Bell Pottinger deal, reportedly worth £100,000 a month, to help defend the family brand.

The brothers Ajay, Atul and Rajesh Gupta arrived in South Africa from India when apartheid ended in the early 1990s and started building a business empire. They operated inconspicuously until 2013, when stories about how their private wedding guests were allowed to land at an air force base revealed their deep political connections.

Since then, the scandals have multiplied, with the brothers accused of directing Zuma’s decisions for their own benefit. The family has always denied wrongdoing, but the evidence against it includes a claim by the former deputy finance minister Mcebisi Jonas that the Guptas offered him the top job in the ministry, which he declined. By last year, the family’s reputation was so stained that South Africa’s four major banks closed accounts connected to it. By the time the Guptas engaged Bell Pottinger to handle their public relations, they were under heavy media scrutiny.

A large email leak in May from inside the Gupta empire enabled the South African media to expose the nature of the family’s alleged efforts to distract attention from its businesses and dealings with the state, which, among other things, reportedly involved the targeting of journalists, rent-a-crowd protests and the “capturing” of political leaders. Twitter users, the emails suggest, were paid to troll journalists or spread propaganda; digital bots were used to amplify fake stories; Wikipedia pages were allegedly altered. The website WMC Leaks was set up and proceeded to smear some of South Africa’s top editors. (The allegations against Bell Pottinger are limited to its communications work.)

Meanwhile, journalists were also subjected to sexual slurs, or had their homes vandalised. “I have never in my life encountered a situation where I have clearly been surveilled and then accused of cheating on my wife by faceless people,” says Peter Bruce, a columnist and former editor of Business Day, a leading broadsheet.

Central to the campaign was the promotion of the idea of “white monopoly capital” – that white-owned business is the true enemy standing in the way of South Africa’s progress. The term was spread online and used in political speeches and in media outlets linked with the Guptas. Critics of the family and Zuma were accused of colluding with or being in the pocket of wealthy whites.

“Running a campaign that stokes racial tensions and the anger of the poor and others who feel the bite of poverty and inequality was bound to and did exacerbate racial polarisation,” says Madonsela.

Jonathan Jansen, the former vice-chancellor at the University of the Free State in Bloemfontein, says that Bell Pottinger should donate the money it earned from the Guptas to civil society organisations in South Africa. He accuses the company of having “played the colluding role of the neo-colonial paymaster with a stunning lack of self-reflection”.

After the emails were leaked, South Africans sent thousands of tweets to Bell Pottinger, forcing the firm to make its Twitter account private. In April, the company finally parted ways with the Guptas, and this month the Bell Pottinger chief executive, James Henderson, felt compelled to issue an “unequivocal and absolute” apology to anyone impacted by the “economic emancipation” campaign on social media.

“Much of what has been alleged about our work is, we believe, not true. But enough of it is to be of deep concern,” said Henderson.

Bell Pottinger has hired the law firm Herbert Smith Freehills to investigate its work with the Guptas and says that it will publish the findings. Besides firing the lead partner on the Gupta project, Bell Pottinger also suspended three other employees. The UK’s Public Relations and Communications Association is conducting a separate investigation.

In his statement, Henderson admitted that the social media campaign was “inappropriate and offensive”. “For it to be done in South Africa, a country which has become an international beacon of hope… is a matter of profound regret… These activities should never have been undertaken.”

This has not quelled the anger in South Africa, where there are growing calls for Bell Pottinger to appear before the country’s parliament and for criminal prosecutions.