China's top legislature on Saturday voted to abolish a punishment on sex workers and their clients, known as the "custody and education" system.
The decision - set to go into effect on Sunday - was passed at the end of a six-day bimonthly session of the National People's Congress Standing Committee.
After enactment, those currently undergoing "custody and education" shall be discharged from the penalty without serving the remaining time.
Prostitution is still illegal under the law on penalties for the administration of public security.
The Criminal Law also stipulates the crimes and penalties for organizing and forcing prostitution.
The detention system was introduced over 20 years ago and has had a major role in the country, but according to the official Xinhua News Agency, the measures have been applied less in practice as "China's legal system keeps improving and the law-based governance advances."
Tsinghua University law professor He Haibo said abolishing the system is "in keeping with the spirit of the rule of law."
"Abolishing the custody and education of those involved in prostitution is in keeping with the spirit of rule of law and protecting human rights," Professor He told the South China Morning Post.