China has announced a ban on torture, extortion and beatings in holding centers used to detain illegal migrant workers. The government hopes the move will end abuses in a system designed to prevent rural migrants from flooding China's cities.

The announcement is a rare Chinese government admission that serious abuses did occur in the so-called "custody and repatriation" centers. It is also a notable instance of public demands for government reform being met by Beijing.

The government's move follows a much publicized murder case involving a young worker in the southern Chinese city of Guangzhou.

On March 18, police stopped a 27-year-old graphic designer named Sun Zhigang and sent him to a repatriation center after he could not produce proper work papers. Two days later he was discovered beaten to death in the center's health clinic, victim of an alleged police sanctioned attack by other detainees.

The brutal circumstances of his death galvanized a widespread outcry against the treatment of China's migrant workers.

Each year millions of migrant workers flood into China's cities hoping to find higher paying jobs, despite the risk of being caught by authorities. Getting caught usually means a trip to one of China's 820 custody and repatriation centers.

"We came across a number of people who actually died of mistreatment or beating or torture in the C&R centers," said Nicholas Becquelin, who monitors the plight of migrant workers for Human Rights in China in Hong Kong. "This is certainly only the tip of the iceberg."

Mr. Becquelin says many detainees are held indefinitely, and none have access to judicial review. In some cases, he said, detainees are sold as indentured servants, forced to work in order to pay for their own detention.

At least three million people have been detained this year and held at government centers around the country.

Sun Zhigang's murder attracted tremendous media coverage, much of it unusually critical of the government's policies.

On Monday state media reported Premier Wen Jiabao signed into law new rules establishing more humane shelters for illegal migrant workers.

Detainees will now be guaranteed food, shelter, medical care and the right to contact their families. The new regulations also forbid shelter staff from beating detainees or extorting from them.

A total of 18 people were convicted for the murder of Sun Zhigang, 12 were given the death penalty.