New Mexico has a new medical marijuana law with a twist: It requires the state to grow its own.

The law, effective Sunday, not only protects medical marijuana users from prosecution — as 11 other states do — but requires New Mexico to oversee a production and distribution system for the drug.

"The long-term goal is that the patients will have a safe, secure supply that doesn't mean drug dealers, that doesn't mean growing their own," said Reena Szczepanski, director of Drug Policy Alliance New Mexico.

The state Department of Health must issue rules by Oct. 1 for the licensing of marijuana producers and in-state, secured facilities, and for developing a distribution system.

The law was passed in March and signed by Gov. Bill Richardson, who is running for the Democratic presidential nomination.

Other states with medical marijuana laws are Alaska, California, Colorado, Hawaii, Maine, Montana, Nevada, Oregon, Rhode Island, Vermont and Washington. Maryland's law doesn't protect patients from arrest, but it keeps defendants out of jail if they can convince judges they needed marijuana for medical reasons.

Connecticut's governor vetoed a medical marijuana bill recently.

The distribution and use of marijuana are illegal under federal law, and the U.S. Supreme Court ruled in 2005 in a California case that medical marijuana users can be prosecuted.

Faced with that dilemma, the health department has asked state Attorney General Gary King whether its employees could be federally prosecuted for running the medical marijuana registry and identification card program, and whether the agency can license marijuana producers and facilities.

"The production part is unprecedented. ... No other state law does that," said Dr. Steve Jenison, who is running the program for the health department. "So we're trying to be very thoughtful in how we proceed."

In the meantime, however, patients must obtain their own supplies.

The state will immediately begin taking applications from patients whose doctors certify they are eligible for the program.

Within weeks, approved patients — or their approved primary caregivers — would receive temporary certificates allowing them to possess up to six ounces of marijuana, four mature plants and three immature seedlings. That's enough for three months, the department says.

The law allows the use of marijuana for specified conditions including cancer, glaucoma, multiple sclerosis, epilepsy and HIV-AIDS, as well as by some patients in hospice care.

An eight-member advisory board of doctors could recommend that other conditions be added to the list.

Martin Walker was diagnosed four years ago as HIV positive and uses marijuana to combat nausea and depression. He said he looks forward to being able to obtain the drug legally.

"If there's a system in place that's going to allow me to do this treatment without having to break the law ... I'll just be able to sleep better at night," said Walker, who runs HIV prevention and other outdoor-based adult health programs for the Santa Fe Mountain Center.