Updated

Nearly three weeks after a Bangladesh garment-factory building collapsed, the search for the dead ended Monday at the site of the worst disaster in the history of the global garment industry. The death toll: 1,127.

Mohammed Amir Hossain Mazumder, deputy director of fire service and civil defense, told The Associated Press the search for bodies from the April 24 collapse was called off at 6 p.m. "Now the site will be handed over to police for protection. There will be no more activities from fire service or army," he said.

Bulldozers and other vehicles have been removed from the building site, which will be fenced with bamboo sticks. Red flags have been erected around the site to bar entry.

The last body was found on Sunday night. A special prayer service will be held Tuesday to honor the dead, he said.

For more than 19 days Rana Plaza had been the scene of frantic rescue efforts, anguished families and the overwhelming smell of decaying flesh.

Miracles were few, but on Friday, search teams found Reshma Begum, a seamstress who survived under the rubble for 17 days on dried food and bottled and rain water.

Begum spoke to reporters Monday from the hospital where she is being treated in a Dhaka suburb. She told them she never expected to be rescued alive, and she vowed, "I will not work in a garment factory again."

The collapse of the Rana Plaza building focused global attention on hazardous conditions in Bangladesh's powerful garment industry. On Monday, the government agreed to allow the country's garment workers to form trade unions without permission from factory owners as part of growing concessions for industry reform.

Bangladesh is the third-biggest exporter of clothes in the world, after China and Italy. There are 5,000 factories in the country and 3.6 million garment workers.

But working conditions in the $20 billion industry are grim, a result of government corruption, desperation for jobs, and industry indifference. Minimum wages for garment workers are among the lowest in the world at 3,000 takas ($38) a month.

The Rana Plaza owner and eight other people, including garment factory owners, have been detained in the collapse investigation. Authorities say the building owner added floors to the structure illegally and allowed the factories to install heavy equipment that the building was not designed to support.

The Cabinet decision to allow trade unions came a day after the government announced a plan to raise the minimum wage for garment workers. Both moves are seen as a direct response to the collapse of the building, which housed five garment factories.

Government spokesman Mosharraf Hossain Bhuiyan said the Cabinet approved an amendment to the 2006 Labor Act lifting restrictions on forming trade unions in most industries. The old law required workers to obtain permission before they could unionize.

"No such permission from owners is now needed," Bhuiyan told reporters after the Cabinet meeting presided over by Prime Minister Sheikh Hasina. "The government is doing it for the welfare of the workers."

Local and international trade unions have long campaigned for such changes.

Though the 2006 law technically allowed trade unions -- and they exist in many of Bangladesh's other industries -- owners of garment factories never allowed them, saying they would lead to a lack of discipline among workers.

Trade union leaders responded cautiously.

"The issue is not really about making a new law or amending the old one," said Kalpana Akter of the Bangladesh Center for Workers Solidarity, a group campaigning for garment workers' rights. "In the past whenever workers tried to form associations they were subjected to beatings and harassment," she said. "The owners did not hesitate to fire such workers."

In recent years the government has cracked down on trade unions attempting to organize garment workers. In 2010 Hasina's government launched an Industrial Police force to crush street protests by thousands of workers demanding better pay and working conditions.

That year police arrested at least six activists, including Akter, on charges of instigating workers to vandalize factories. They were later freed, but some charges are still pending.

The activists are also angry that police have made no headway in the investigation of the death of a fellow union organizer, Aminul Islam, who was found dead a day after he disappeared from his home in 2012.

"Islam's case is going nowhere even though police say they are investigating," said Akter.

On Sunday, the government set up a new minimum wage board that will issue recommendations for pay raises within three months, Textiles Minister Abdul Latif Siddiky said. The Cabinet will then decide whether to accept those proposals.

The wage board will include representatives of factory owners, workers and the government, he said.

Since 2005, at least 1,800 garment workers have been killed in factory fires and building collapses in Bangladesh, according to research by the advocacy group International Labor Rights Forum.

In November, 112 workers were killed in a garment factory in Dhaka, the Bangladeshi capital. The factory lacked emergency exits, and its owner said only three floors of the eight-story building were legally built.