Years after passing a groundbreaking law aimed at bringing San Francisco's pot clubs under government control and giving patients safe access to medical marijuana, the city is finally regulating those businesses, which for years operated with little oversight.

The Board of Supervisors approved legislation requiring medical cannabis clubs to get city permits in late 2005. But initiating the law has been a complicated and controversial process.

More than three years later, the city has issued 10 permits to cannabis clubs, and 13 more are in the pipeline, according to the Department of Public Health. There are now 23 clubs in the city, officials said, as compared to more than 40 when the process began in 2005; five applications have been rejected and many others clubs apparently closed without bothering to apply for a permit.

A number of medical marijuana advocates, who had concerns when the legislation was introduced, recently praised the program, though they added that it is still a work in progress.

The program has admittedly taken far longer to get started than city officials initially envisioned. The deadline for existing clubs to secure the permits was last Tuesday, a date that was already extended twice over the past three years.

Acknowledging how difficult it has been for clubs to secure the permits, the Department of Public Health announced on Jan. 16 that some clubs could apply for temporary permits. And freshman Supervisor David Campos is working with patient advocates and other city officials to craft new legislation that will aim to work out any remaining kinks in the regulatory process.

"It's taken a long time," said Supervisor Ross Mirkarimi, who wrote the original legislation and agreed the process could still be refined. "But the regulations are working."

Most of the delays, according to pot club owners, stem from zoning rules, a requirement that the clubs be handicap-accessible and the fact that four city agencies are involved in the process. To receive a permit, the clubs have pay a $7,000 fee to the Department of Public Health and then gain approval from the Planning Department, the mayor's Office on Disability and the Building Department.

"The process is difficult - that's why less than half of the clubs have completed it," said Charlie Pappas, who owns Health and Wellness Alternatives at 935 Howard St. "But I really give city officials and staff credit for trying to make it work and not dragging their feet."

Pappas, who is in a wheelchair, has ironically not yet received his permit because of accessibility issues. He expects to get the permit within two months, he said.

Those sorts of problems are not unique, said attorney Patrick Goggin, who represents two other cannabis clubs. Goggin said the biggest hurdles for club owners has been the cost of upgrades and the fact that the easiest solution to the disability-access problems - moving to another building - forces owners to start the permitting process all over.

Goggin said one of his clients, the Vapor Room on Haight Street, had to move next door because its original space was not properly zoned. After the move, the Vapor Room still had to spend more than $100,000 making the necessary building improvements.

"In theory what the city has done with the regulations is great, and I think it surpasses any other city or county regulations in the state," he said. "But in addition to it being a complex system, numerous agencies have jurisdiction - one of our clients has had their permit lost numerous times."

The original law was proposed as the city's number of pot clubs exploded, from nine to more than 40 over a five-year period. The law grew out of concern that the clubs were operating with no oversight, often near schools and recreation sites, and were attracting criminal activities such as street drug dealing.

In addition to the permitting process, which includes public hearings, the law established rules for who can run the clubs and restricts their locations to commercial and industrial areas and places more than 1,000 feet from schools or youth facilities.

The city stepped in because while medical marijuana is legal under state law, it is illegal in the eyes of the federal government.

Officials in San Francisco - whose elected leaders generally support medical cannabis - have had to weigh the need for regulation with the concern that any paper trail will make it easier for the federal government to prosecute club owners and medical marijuana users. The federal government has continued to go after cannabis clubs, in late 2007 threatening landlords who rent to the businesses with criminal prosecution.

In response, the state attorney general issued a set of guidelines last year for medical marijuana clubs, including that they operate as nonprofits. San Francisco Mayor Gavin Newsom has proposed legislation to require that the clubs operate as nonprofits.

While many medical marijuana advocates support the nonprofit requirement, Goggin and others said that it, combined with the cost associated with getting city permits, have resulted in a de facto moratorium on clubs. Others, however, said that the shuttering of some clubs means that the system is working.

Patient advocate Shona Gochenaur said the permitting process and nonprofit requirement have pushed some clubs out of business. Those were generally dispensaries focused on making money, not providing safe access to patients, she said.

"There were bad players and those things discouraged them and that's good," Gochenaur said. "We want to show the rest of the nation that there are good players and that the safe-access system can work."