By Stephen Gibbs
BBC News, Mexico City
The move is intended to discourage corrupt police from taking bribes
The Mexican government has enacted a law decriminalising the possession of small amounts of drugs, including cocaine and heroin.
Mexican prosecutors say the move does not amount to legalisation.
They say it is designed to prevent corrupt police from seeking bribes from small-time drug users, and to encourage addicts to seek treatment.
The move comes amid a drug war in Mexico that has claimed more than 11,000 lives in the last three years.
Those found in possession of the equivalent of four joints of marijuana, or four lines of cocaine will no longer be viewed as criminals.
Instead they will be encouraged to seek government-funded drug treatment, which will be compulsory if users are caught a third time.
The new law applies to a wide range of drugs, including heroin and methamphetamine.
The Mexican attorney general's office says that, previously, individual police officers could choose whether to arrest or just caution small-time drug users, a situation which encouraged bribery.
It is hoped this change will free up police time to tackle major drug traffickers.
Since President Felipe Calderon launched his military crackdown on the Mexican cartels three years ago, almost 100,000 people have been detained on minor drug possession charges.
The vast majority are later released without charge.
Despite this change in the law, the Mexican government says it has no intention of permitting full legalisation of drugs - which some analysts suggest is the only way to take the trade from the hands of criminal gangs.
Mr Calderon has said that such a move would be "suicidal" for Mexican society.