BAKERSFIELD, Calif. (AP) — Kern County has banned the sale of marijuana even as California legalizes it.

The Bakersfield Californian reports that county supervisors voted 4-1 Tuesday to prohibit commercial cannabis growing and sales.

Supervisors said marijuana has had a destructive impact on local communities.

Twenty-eight medical marijuana dispensaries currently operating legally in Kern County would be phased out — although officials warn that illegal shops would remain a problem.

County Counsel Mark Nations says opponents of the ban could decide to sue or try to float a measure asking voters to overturn it.

California voters last year passed Proposition 64, which legalized recreational pot sales to adults. It takes effect next year.

However, cities and counties still have the option of prohibiting sales.

Pot sales also remain illegal under federal law.