Illegal gold mining has plagued South Africa's mining companies for decades, robbing the industry and state coffers of billions of rand through smalltime pilfering as well as networks run by organised crime.
Now, with unmined output dwindling and proving more difficult to extract, one firm has had enough: diversified precious metals producer Sibanye Gold says that it will clear all illegal miners from its shafts by the end of January next year.
"We will have them out then," said Sibanye's chief executive Neal Froneman. His campaign slogan is "Zero Zama", after the Zulu for illegal miners, "zama zamas" or "taking a chance". A Gold Fields spin-off formed in 2013, Sibanye is the first company to set itself a deadline to stop the practice and has laid out 200 million rand ($15 million) to make it happen.
The challenge is immense, however. Sibanye may win most of the battles but it will lose the war in a country beset by joblessness, poverty, crime and porous borders, experts say.
Most zama zamas are undocumented immigrants from neighbouring countries that have long provided migrant labour for South Africa's mines who are now being laid off. The syndicates who support them and traffic the illegal metals are well-funded, well-established and highly dangerous, security experts say.
"Sibanye can get it down by 90 percent, but they will never eradicate it completely," said Louis Nel, a security consultant who works on the fertile mining West Rand area near Johannesburg. "You must never underestimate the ability of an illegal miner."
The stakes are high. Illegal gold mining costs South Africa's government and industry more than 20 billion rand ($1.5 billion) a year in lost sales, taxes and royalties, the Chamber of Mines estimated in an unpublished document submitted to parliament in March.
Areas around both abandoned shafts and working mines are also made unsafe by the theft of copper, power cables and other infrastructure, it said in the document.
The operational security budget in Sibanye's gold division alone is 400 million rand in 2017, equal to almost 20 percent of its headline earnings last year.
"If they are able to resolve the issue, it will be a positive," said Hanré Rossouw, a portfolio manager with Investec, which holds shares in Sibanye.
Sibanye's strategy for eradicating the problem is multi-pronged: a tip-off and reward system to encourage employees to report suspicious activity, tactical security units that can go underground to make arrests, and access checks such as biometrics, also used by rivals such as Harmony, to ensure only authorised personnel gain entry.
The tip-off system is aimed at employees who may be on the take, providing the zama zamas access to working shafts. The biometrics prevent them from gaining access and the tactical units are there to arrest the illegals if they do get through.
A decade ago, virtually none of these systems existed.
One front in Sibanye's war is the Masimthembe mine 70 km west of Johannesburg, its most profitable gold operation, helping it offer a dividend of 4.856 percent compared to an local industry average of 2.1 percent, much to the envy of its peers.
Masimthembe used to be the gateway to other shafts at nearby operations through a network of linked tunnels. Now it has been effectively cleared of zama zamas, Sibanye says.
To gain access to elevator cages going down to the mine, visitors must negotiate a series of high-tech turnstiles which require a biometric reading of your index fingers and can trap you if you are not authorised to pass. This is an upgrade from older models, which allowed illegal miners to "piggyback" behind employees.
Underground, Sibanye miners and security workers showed the kind of spot favoured by illegal miners, an area where ore blasted in legal mining operations has been scraped away from the rockface.
There, zama zamas wash rocks that have been left behind over a metal plate wrapped in carpet. The gold-bearing material gets caught in the carpet, which is then washed out in a bucket of water. After mercury is added, presto: a nugget that may be 50 percent gold.
The work is dangerous and hazards include rock falls. The chamber submission to parliament said the bodies of 76 zama zamas were recovered underground in 2016, compared to 73 fatalities in the country's legal mining industry.
The zama zamas can spend weeks underground, supported by criminal networks who provide tools, food and water. These syndicates plug into a murky network of buyers who, according to the Chamber of Mines and a UN report last year, pass the illicit gold to local and international distributors. Dubai and India are believed to be key end markets.
Sometimes rivalries break out into violence. In March, 14 bodies of illegal miners shot or bludgeoned to death were uncovered in Benoni, a suburb east of Johannesburg, which is home to scores of abandoned shafts. "We believe this was part of a turf war over illegal mining," said police spokesperson Athlenda Mathe.
Nel, formerly in the South African military, has had hair-raising experiences. On one recent job for liquidators to clear a derelict mine, he and his teams regularly had gun battles with zama zamas on the surface. "In a five-month period, I was narrowly missed by bullets seven times," he said. He said they cleared the vast majority of the illegal miners from the area but when his contract ended, they returned en masse.
Nash Lutchman, Sibanye's head of security, said the problem of illegal mining only became a priority with the mass lay-offs. Industry data shows employment in South Africa's gold sector has fallen to 116 000 in 2016 from a peak of over 540 000 in 1987.
"Employees were stealing for themselves and are probably still stealing for themselves. Security was on the take, shift bosses were looking the other way, the mine overseer did not really worry," Lutchman said. "When people started losing their jobs, then it started becoming (known as) 'illegal mining'," he said.
Returning to the surface at Masimthembe, visitors are frisked by security guards who do a thorough pat-down and check the inside of the big rubber boots worn underground, something that was not regular practice in the past.
During a recent visit to one Sibanye mine, two foreign investors who innocently plucked rocks as keepsakes were startled when mine security tried to detain them, according to a company source who asked not to be named. Managers defused the situation. But it showed the upgraded security – to some extent – was working.