Emergency workers in South Africa say they have successfully rescued 12 illegal miners trapped in an abandoned gold shaft near Johannesburg.

But a number of other miners have refused to come to the surface because they fear arrest, emergency services spokesman Werner Vermaak said.

"Once the 12 miners have been brought to surface and the others got word or wind that they got arrested and cleared medically, they actually refused to be rescued," he said.

"So, some of them did not want to be rescued by the mine rescue workers and rather decided to stay back.

"It's too dangerous to go down."

Mr Vermaak says the rescue operation is at an end and those who have emerged have been medically checked before being handed over to police for questioning.

Private mine security guards are stationed around the shaft and police are on hand to arrest any other miners who come out.

It is unknown exactly how many miners remain underground.

There are no immediate reports of deaths or injuries.

An entrance to the mine where the miners are trapped. ( Twitter: ER24JHBEast )

Some of the trapped group had told rescuers that 200 more illegal diggers were deeper in the mine, but rescue workers later said the claims were unlikely to be true.

The group became trapped by fallen boulders below the surface at the old mine site in the semi-rural suburb of Benoni.

A police patrol in Benoni, where gold has been mined for decades, had been alerted by shouts from the trapped miners.

A crane was used to shift a large concrete slab that was obstructing the shaft belonging to the Chinese-owned bullion producer Gold One.

The company is not currently working the mine.

Illegal mining of abandoned shafts is common in South Africa, where miners excavate ore to sell, often living underground in dangerous and precarious conditions.

Fatal accidents are common and underground battles between rival groups have also been reported.

Gold One spokesman Grant Stuart said the miners were trapped in the "New Kleinfontein 6" ventilation shaft.

"The illegal miners have dug a tunnel right next to it to access the shaft and it has collapsed behind them," he said, adding that heavy rain may have triggered the collapse.

ABC/wires