With the Los Angeles City Council poised to take up a medical marijuana ordinance after two years of contentious debate, L.A. County Dist. Atty. Steve Cooley warned Tuesday that he intends to prosecute dispensaries that sell the drug even if the city's leaders decide to allow those transactions.

"The L.A. City Council should be collectively ashamed of their failure to grasp this issue," Cooley said, arguing that state laws do not allow medical marijuana to be sold. "Undermining those laws via their ordinance powers is counterproductive, and quite frankly we're ignoring them. They are absolutely so irrelevant it's not funny."

The council may vote today on the ordinance, which would regulate medical marijuana dispensaries and allow the city to shut down hundreds that have opened despite a moratorium approved more than two years ago.

Cooley's broadside came a day after two council committees rejected the city's attorney's advice to ban sales.

The ordinance they recommended would allow dispensaries to accept cash contributions as long as they comply with state law, a provision Cooley derided as "meaningless" and said reflected "Alice-in-Wonderland thinking." Cooley and City Atty. Carmen Trutanich maintain that recent court decisions clearly indicate collectives cannot sell marijuana over the counter, although members can be reimbursed for the cost of growing it.

Councilman Ed Reyes, who has overseen the development of the city's ordinance, called Cooley's remarks "demeaning" and "a real shame." But Reyes said he did not think they would dissuade the council.

"This is about the quality of life. We all have better things to do than this legal jousting," he said. "It makes no sense to play political football with people's lives."

Cooley insisted that most, if not all, dispensaries are breaking the law by accepting money in exchange for marijuana and promised to step up felony prosecutions next month. "It's a target-rich environment," he said. "People think they are getting the green light."

The clash between the City Council and district attorney puts Los Angeles at the center of a growing debate about the legality of dispensaries. Although Cooley has recently emerged as the most pugnacious opponent of these stores, his views are increasingly shared by prosecutors, sheriffs and police chiefs.

"In Southern California, there's much more consistency among the D.A.s' offices than you might think," Joe D'Agostino, senior assistant district attorney in Orange County, said recently. "I think we would probably be in line with Steve Cooley in that almost all of the dispensaries as they are described to us are in violation of the law."

Three of the state's largest cities -- Los Angeles, Long Beach and San Diego -- are wrestling with ordinances that would allow dispensaries, but their deliberations have been complicated by prosecutors in those jurisdictions.

In Long Beach, City Prosecutor Tom Reeves has said some dispensaries are little more than fronts for illegal drug sales. "What's the difference between that and a drug dealer on the corner?" he said.

The debate kicked up this year in the wake of several recent state court rulings.

Some prosecutors and law enforcement officials argue the decisions bolstered their long-held view that neither Proposition 215, which voters approved in 1996, nor the state's Medical Marijuana Program Act, which the Legislature passed in 2003, specifically allow for sales.

In September, Trutanich sent the council a nine-page review of the case law.

"This is an area where the intent of the law is very clear. Collectives are allowed to grow this and distribute it amongst themselves," he said Tuesday. "Not one sentence says sales are allowed."

Lawyers for medical marijuana advocacy groups have countered with their own analyses.

The Union of Medical Marijuana Patients recently delivered a 23-page legal review to council members. "We're really disappointed because we have been thinking that the district attorney would have respect for what the City Council would come up with," said James Shaw, the group's director. "We're taking his threats as real."

Joe Elford, chief counsel for Americans for Safe Access, said that properly organized collectives can sell marijuana, citing guidelines issued last year by California Atty. Gen. Jerry Brown. "The idea that a nonprofit collective can't sell things is just a bizarre interpretation of the law," he said.

The first indication that law enforcement in Los Angeles County was focusing on the issue came in August, when Cooley and Sheriff Lee Baca warned in a letter to city officials and police chiefs that "over-the-counter sales of marijuana are patently illegal." They suggested that cities ban dispensaries.

The letter distressed officials in West Hollywood, which allows four dispensaries, but Baca said recently that he considers the city's ordinance a model that L.A. should follow.

On Tuesday, however, Cooley said West Hollywood's dispensaries appear to be engaged in illegal sales as well. "The sheriff is obligated to uphold the law too," he said.

Cooley and Trutanich urged the council not to adopt a measure they think conflicts with state law. "We may pass an ordinance that says cannibalism is legal, but the state has a different view," Trutanich said.

The two prosecutors, who are close political allies, also said the council would be doing a disservice to its constituents by passing the ordinance. "If we're setting them up to be convicted felons, that's intellectually dishonest," Trutanich said.

But Reyes said state law is not clear on the issue. "We'll let the courts decide," he said. "We are trying our very best to work with a system that is very vague at this moment."

Cooley's view is shared by others in law enforcement.

Three years ago, the Riverside County District Attorney's office issued a white paper that concluded storefront dispensaries are illegal. More recently, the California Police Chiefs Assn. published a white paper that concluded: "All marijuana dispensaries should generally be considered illegal and should not be permitted to exist and engage in business within a county's or city's borders."

Dennis Tilton, retired counsel to the San Bernardino County Sheriff's Department, edited that report. He said he has never seen a dispensary that he believed was operating as required by state law, but he also added, "I can't say that prosecuting dispensaries should be regarded as one of law enforcement's highest priorities."

Before Cooley issued his threat to prosecute dispensaries last month, San Diego County Dist. Atty. Bonnie Dumanis spearheaded high-profile raids against 14 dispensaries. At a news conference in September, she denounced them as "dope houses selling marijuana cookies to string on customers" and "drug dealers who see an opening in the market and a way to make a fast buck."

Dumanis said the raids were intended to send a message to the scores of dispensaries that opened in the county this year. "We're not done," she said in an interview. "People are on notice."