A medical marijuana activist who was forced to return to the United States earlier this year has been freed from jail after serving a third of his four-month sentence for drug possession, officials said.

Steve Kubby was released after 40 days for good behavior and because of a need to reduce crowding under a federal court order, Placer County jail officials said.

He fled to Canada following his 2001 conviction for possession of a hallucinogen found in peyote and a psychedelic mushroom. He repeatedly sought refugee status, claiming he was persecuted for his advocacy of medical marijuana use. A Canadian court rejected his appeals in January.

Kubby lost 25 pounds in jail but said he gained respect for his jailers and the medical staff that treated him. Kubby says he has used marijuana to curb symptoms from a rare form of adrenal cancer.

"I realized the taunting and skepticism about my condition that I experienced when I was first jailed here in 1999 was not present with any of the jail staff this time," he said.

Kubby, the 1998 Libertarian candidate for governor, had gained attention when he helped write and lobby for the state's medical marijuana law. The law, approved by voters in 1996, decriminalized the use of marijuana for medical purposes under state law, but it remains illegal under federal law.

Kubby still faces a March 14 hearing for failing to appear at his original sentencing five years ago.