The last of 3,200 miners trapped for more than 24 hours in a deep mine shaft were brought to safety late Thursday, ending one of South Africa's biggest ever rescue operations, officials said.

The final workers emerged just after 9 p.m. local time, according to officials for the mine owner, Harmony Gold Mining Co.

Click here to view photos.

Rescuers had worked during the day to bring up the remaining 500 South African gold miners trapped for more than a day deep in a shaft after an accident damaged an elevator.

There were joyful reunions on the surface Thursday and — although none of the 3,200 trapped in all was injured or killed — also anger, fear and renewed concern about safety standards in a country that is the world's largest gold producer.

A pressurized air pipe snapped at the mine near Johannesburg and tumbled down a shaft Wednesday, extensively damaging an elevator. Some of those stranding more than a mile underground had gone down Tuesday for the night shift.

The trapped workers were being brought to the surface in a second, smaller cage in another shaft that can hold about 75 miners at a time, about half the normal passenger capacity. Most of the miners who emerged into the blinding sunlight looked dazed and exhausted.

"We nearly died down there," one man yelled as he walked past reporters. "I'd rather leave (the job) than die in the mine."

One large group emerged from the shaft singing traditional songs and stamping their feet with joy despite their exhaustion. They were greeted by a crowd of ululating female miners.

The mine owner, Harmony Gold Mining Co., and South Africa's minerals and energy minister vowed to improve safety in one of the country's most important industries after the accident prompted allegations the industry cut safety corners and didn't properly maintain the mine.

The union threatened unspecified "industrial action" if its safety demands were not met. In a message to mining bosses, it said it would "hit their pockets big time in the near future."

Amelia Soares, spokeswoman for Harmony, said the mine had won a number of safety awards and had never seen any fatal accidents. She said the company was likely to suffer considerable losses in output during the closure caused by the accident.

Minerals and Energy Minister Buyelwa Sonjica said Thursday that Elandsrand, a top-producing gold mine in South Africa, would be closed for at least six weeks following the accident.

Harmony chairman Patrice Motsepe said, according to the South African Press Association: "We have to recommit ourselves to refocus on safety in this country; our safety record both as a company and an industry leave much to be desired."

Harmony's Elandsrand mine is the third largest producing gold mine in South Africa. The company said it produces an average of about 1,300 pounds of gold every month.

Last year, 199 mineworkers died in accidents, mostly rock falls, the government reported in September. One worker was killed last week in a mine adjacent to Elandsrand.

Thabo Gazi, chairman of the Mine Health and Safety Council, a group of government, labor and employer representatives that advises the government and that will investigate the Elandsrand accident, said he had raised concerns with the government that in the effort to ensure maximum profits for minimum costs, safety standards were being compromised.

But Terence Creamer, editor of Engineering News and contributing editor for Mining Weekly, a leading engineering and mining publication, said the mining activity spurred by high prices did not mean safety would be compromised. He said because of the costs associated with accidents and production stoppages, owners of mines that did not have very high yields could not take the risk of bad safety records.