MEXICO CITY (Reuters) - Possessing marijuana, cocaine and even heroin will no longer be a crime in Mexico if the drugs are carried in small amounts for personal use, under legislation passed by Congress. The measure given final passage by senators in a late night session on Thursday allows police to focus on their battle against major drug dealers, the government says, and President Vicente Fox is expected to sign it into law. "This law provides more judicial tools for authorities to fight crime," presidential spokesman Ruben Aguilar said on Friday. The measure was approved earlier by the lower house. Under the legislation, police will not penalize people for possessing up to 5 grams of marijuana, 5 grams of opium, 25 milligrams of heroin or 500 milligrams of cocaine. People caught with larger quantities of drugs will be treated as narcotics dealers and face increased jail terms under the plan. The legal changes will also decriminalize the possession of limited quantities of other drugs, including LSD, hallucinogenic mushrooms, amphetamines and peyote -- a psychotropic cactus found in Mexico's northern deserts. The legislation came as a surprise to Washington, which counts on Mexico's support in its war against drug smuggling gangs who move massive quantities of cocaine, heroin, marijuana and methamphetamines through Mexico to U.S. consumers. A delegation from the U.S. House of Representatives visited Mexico last week and met with senior officials to discuss drug control issues, but was told nothing of the planned legislative changes, said Michelle Gress, a House subcommittee counsel who was part of the visiting team. "We were not informed," she told Reuters. HARDENED CRIMINALS Hundreds of people, including many police officers, have been killed in Mexico in the past year as drug cartels battle for control of lucrative smuggling routes into the United States. The violence has raged mostly in northern Mexico but in recent months has spread south to cities like vacation resort Acapulco. Under current law, it is up to local judges and police to decide on a case-by-case basis whether people should be prosecuted for possessing small quantities of drugs, a source at the Senate's health commission told Reuters. "The object of this law is to not put consumers in jail, but rather those who sell and poison," said Sen. Jorge Zermeno of the ruling National Action Party. Fifty-three senators voted for the bill with 26 votes against. Hector Michel Camarena, an opposition senator from the Institutional Revolutionary Party, warned that although well intentioned, the law may go too far. "There are serious questions we have to carefully analyze so that through our spirit of fighting drug dealing, we don't end up legalizing," he said. "We have to get rid of the concept of the (drug) consumer."