There are more than two million sex workers in India
India's Supreme Court has asked the government to consider whether it might legalise prostitution if it is unable to curb it effectively.
The court said legalising prostitution would help in the monitoring of the trade and rehabilitating sex workers.
Although illegal, prostitution is a thriving business in cities and towns across India.
It is estimated that there are more than two million female sex workers in the country.
The court's remarks came while dealing with a public interest litigation filed by an NGO about child trafficking.
The court said child trafficking and prostitution were flourishing because of poverty.
"When you say it is the world's oldest profession and you are not able to curb it by laws, why don't you legalise it?" Judges Dalveer Bhandari and AK Patnaik asked a government solicitor.
"You can then monitor the trade, rehabilitate and provide medical aid to those involved."
The solicitor said that he would look into the court's suggestions.
"The [sex workers] have been operating in one way or the other and nowhere in the world have they been able to curb it by legislation," the judges said.
"In some cases, [the trade] is carried out in a sophisticated manner. So, why don't you legalise it?"
A government-commissioned study says that the number of sex workers has risen from two million in 1997 to three million in 2003-04.
Many prostitutes are said to be underage, entering the sex trade as young as 12.
Andhra Pradesh and West Bengal states together account for 26% of the total number of prostitutes in the country.