A medical marijuana dispensary will not be setting up shop near the city's biggest tourist hub after officials denied it a permit late Thursday.

The San Francisco Planning Commission voted 4-2 to reject the application by the Green Cross.

Dozens attended the commission's hearing to voice their opposition to the pot club operating near Fisherman's Wharf, a bustling waterfront area known for its cable cars, postcard views of Alcatraz Island and shops along Pier 39.

Commissioner Michael J. Antonini said he voted against the permit because of concerns by local merchants, who feared the pot club would scare off tourists, as well as concerns by residents, who argued its presence would impair the quality of life in the neighborhood.

"The people who were against granting the permit were from the neighborhood where it would have been located, and those in favor of it were mainly coming from the outside and asking that it be imposed on that area," Antonini said.

The Green Cross was the first cannabis club to seek a permit under strict guidelines the city adopted in November to curb street crime around its roughly 30 dispensaries and prevent sales to non-patients.

This left-leaning city quickly became a hub for cannabis clubs after voters in 1996 made California the first state to legalize medicinal marijuana. Voters in 10 other states have since enacted laws that allow dispensing pot to treat specific medical problems, although the federal government continues to outlaw marijuana.

San Francisco's clubs were largely unregulated before the new rules. Now the owners of dispensaries must submit to criminal and employment background checks, pay for a permit and business license, and are prohibited from operating within 500 feet of schools. That buffer zone is 1,000 feet if pot smoking is allowed on the property.

The Fisherman's Wharf fight highlighted the difficulties of regulating the drug without banishing patients to dark alleys and rough neighborhoods.

The city made the Green Cross close its previous location in the Mission District in March after neighbors complained about rising traffic and crime, which owner Kevin Reed said were unfounded. He said he was forced into the wharf after being rejected by dozens of other landlords.

But local residents who spoke against it at Thursday's hearing noted the number of schools and community centers located within walking distance of the proposed dispensary.

"This is a family neighborhood — it's not right for such an adult-oriented and, to a great degree, counterculture environment," resident Ryan Chamberlin said before the hearing.

Others urged commissioners to consider Green Cross' clean operating record and the patients who need the drugs.

"This is a test case for the medical cannabis dispensaries, and you are going to hear vociferous opposition from neighborhood groups," said Michael Aldridge, a nearby resident who said he would buy marijuana there for unspecified ailments. "Remember, in each place there are people like me who need the dispensary, and Green Cross meets your requirements."