MEXICO CITY (AP)  Mexico enacted a controversial law on Thursday decriminalizing possession of small amounts of marijuana, cocaine, heroin and other drugs while encouraging government-financed treatment for drug dependency free of charge.

The law sets out maximum “personal use” amounts for drugs, also including LSD and methamphetamine. People detained with those quantities will no longer face criminal prosecution; the law goes into effect on Friday.

Anyone caught with drug amounts under the personal-use limit will be encouraged to seek treatment, and for those caught a third time treatment is mandatory  although no penalties for noncompliance are specified.

Mexican authorities said the change only recognized the longstanding practice here of not prosecuting people caught with small amounts of drugs.