A San Francisco ordinance prohibiting tobacco sales in drugstores could violate the equal protection clauses of the state and federal constitutions, a state appeal court ruled Tuesday.

The unanimous decision by San Francisco’s 1st District Court of Appeal reverses a demurrer in the city’s favor and lets Walgreen Co. go ahead with a suit challenging the controversial ordinance