South African police say they will continue to arrest any illegal miners who emerge from a disused gold mine where hundreds, possibly thousands, of people are in hiding.
This follows a court order which said the mine-shaft in Stilfontein, around 90 miles (145km) south-west of Johannesburg, should not be blocked.
Emergency services have been at the site, for several days. Police have been preventing food and water entering the mine to, as one government minister put it, "smoke them out".
The miners - who have been underground for a month - have so far refused to exit the mine over fears of being arrested. Among them are undocumented migrants who also fear deportation.
Some South Africans have heavily criticised the government's hardline policy and, in recent days, the police have been allowing volunteers to go down to see the miners and some have been taking small amounts of food and water.
On Saturday, a court in Pretoria ordered that the mine "shall be unblocked and may not be blocked by any person or institution whether government or private".
It also said that any person in the mine should be allowed to exit, and that "no non-emergency personnel may enter the mine shaft".
Three of the miners surfaced on Saturday, one of whom was taken to hospital for medical treatment. The two others were arrested.
Some reports suggest the miners had resorted to eating vinegar and toothpaste to survive. Volunteers said they pulled a body from the mine on Thursday.
Police have called in experts to assess the integrity of the mine shafts, to inform a decision as to whether they would conduct a forced evacuation, according to the AFP news agency.
Yasmin Omar, an attorney who helped bring the court case, told state broadcaster SABC that the ruling was a temporary order "that will at least allow us to get emergency relief to the people [who] need it".
She said a full hearing on the matter would take place on Tuesday.
"These people underground are dying," Ms Omar said, adding that the ruling means officials "must do all that is reasonable to give medical care to the people who are underground".
In a statement, the South African Police Service (SAPS) welcomed the court order, which it stressed did not prevent officers from making arrests.
It said: "All those who resurface will continue to be assessed by emergency medical personnel on site, as has been the case.
"Those that are in a good health will be processed and detained. Those that require further medical care will be taken to hospital under police guard."
The SAPS added that as of 16:00 local time (14:00 GMT) on Saturday, three of the miners had resurfaced.
More than 1,000 miners have already emerged and been arrested.
South Africa is a mineral-rich country. According to official estimates, it holds nearly 30% of the world's gold deposits and 88% of all platinum deposits.
But many mines have closed down in recent years and miners have been laid off, contributing to a black market that costs the South African government hundreds of millions of dollars each year.
While gold remains a valuable commodity, rising mining costs - exacerbated by electricity disruptions and deeper deposits - have made the vast majority of mines unprofitable, according to the Minerals Council of South Africa, an industry body.
In a bid to survive impoverished circumstances, miners and undocumented migrants are increasingly entering closed mines to dig up their remaining deposits.
Some spend months underground, and illegal mining has spawned a small economy providing food and cigarettes to the miners.
However, the authorities are keen to end the practice. Illegal miners are sometimes recruited by criminal gangs and can be armed.
The SAPS has previously said that among those to resurface from the Stilfontein mine were individuals from Mozambique, Malawi and Zimbabwe.
The force has launched a nationwide operation aimed at combatting illegal mining and related criminal activities.
On 3 November, it said that at least 565 people had emerged from a mine in Orkney, south-west of Johannesburg.
But the South African Human Rights Commission said on Friday that it had begun an investigation into the SAPS's handling of the Stilfontein mine incident, following complaints that the blockade may have infringed the miners' right to life.