A South African court on Saturday ordered an end to the police blockade of a former gold mine, where hundreds, possibly thousands, of illegal miners are thought to be underground.
Police and ambulances have been at the site, in Stilfontein, about 140 kilometres (90 miles) southwest of Johannesburg, for several days.
Police called in experts on Saturday to assess the safety of the mine shafts to help decide if officers could carry out a forced evacuation, police spokesperson Athlenda Mathe told reporters.
But the court order effectively rules out that option.
The Pretoria court order said: "The mine shaft in Stilfontein... shall be unblocked and may not be blocked by any person or institution whether government or private.
"Any miners trapped in the mine shaft shall be permitted to exit; no non-emergency personnel may enter the mine shaft," the judge added.
Earlier this week, a local claimed to have been told there were around 4,000 miners underground.
Police, speaking earlier this week, said the figure was probably in the hundreds, but the illegal miners faced arrest if they came to the surface. On Thursday, a body was brought out of the mine.
The police operation had also cut off supplies of food and water to the underground miners.
On Wednesday, minister of the presidency Khumbudzo Ntshavheni told reporters the government did not intend to step in.
"Honestly, we're not sending help to criminals, we're going to smoke them out. They will come out," she said, with her comments drawing sharp criticism from the opposition.
Since a police operation launched weeks ago to force miners out of the shaft, more than 1,170 people have resurfaced, police spokesperson Mathe told reporters earlier this week.
She said then that the authorities had wanted the miners to leave but would not go down into the shaft it believed was unsafe because of hazardous gases and the possibility some miners had weapons.
Thousands of illegal miners, many of them hailing from other countries, are said to operate in abandoned mine shafts in mineral-rich South Africa.
Locally known as "zama zamas" -- "those who try" in the Zulu language -- the miners frustrate mining companies and are accused of criminality by residents.