COPPEROPOLIS, Calif. (AP) — The four young men had just started their marijuana harvest in rural Northern California when a dozen sheriff’s deputies swooped in with guns drawn, arrested them and spent the day chopping down 150 bushy plants with machetes.

“I could do this every day if I had the personnel,” Calaveras County Sheriff Rick DiBasilio said during the operation near the Sierra Nevada foothills town of Copperopolis, about two hours east of San Francisco.

Authorities this year have cut down close to 30,000 plants grown without permits in a county that is reconsidering its embrace of marijuana cultivation ahead of statewide legalization.

“There are just so many of them,” the sheriff said of the illegal farms. “It’s never-ending.”

Marijuana has deeply divided financially strapped Calaveras County, among many where growers are increasingly open about their operations and are starting to encroach on neighborhoods.

DiBasilio estimates the county — population 44,000 and about the size of Rhode Island — has more than 1,000 illegal farms in addition to the hundreds with permits or in the process of obtaining them. The influx has caused a backlash among residents and led to the ouster of some leaders who approved marijuana cultivation.

Pot farmers operating legally, meanwhile, say they are helping the local economy and have threatened to sue over attempts to stop them.

California is set to issue licenses in January to grow, transport and sell weed for recreational purposes, nearly 20 years after the state first authorized the drug’s consumption with a doctor’s recommendation.

Farmers can legally grow marijuana for recreational consumption next year but are required to get a local permit before applying for a state license, which has sparked a boom in pot-friendly counties.

Calaveras County legalized medical marijuana cultivation last year, seeking to tax the hundreds of farms that popped up in the region after a 2015 wildfire destroyed more than 500 homes.

County officials expected to receive about 250 applications by the 2016 deadline. They got 770. About 200 applications have been approved, a similar number rejected, and the others are still being processed.

The sheriff gets some of the nearly $10 million in fees and taxes paid by legal farmers to crack down on illegal grows, many of which the department has mapped from the air.

The new pot farms have brought a bustling industry that includes the sounds of generators, bright lights illuminating gardens at night, water trucks kicking up dust on their way to grows, the distinct odor of marijuana, and tents, trailers and other temporary housing for migrant workers.

Local hardware stores’ gardening sections are now stocked with pot farming supplies.

Law enforcement officials say they have raided farms where they have found pesticides that are banned in the U.S.

“It has changed our way of life,” said Bill McManus, head of an organization seeking to ban marijuana in Calaveras County. “The environmental impacts are atrocious.”

To the north, even the fabled pot-growing mecca known as the Emerald Triangle has been thrown into political turmoil as more farmers set up shop ahead of legalization.

The California Growers Association estimates about 3,500 farmers in Humboldt, Mendocino and Trinity counties have applied for local permits and will be in a position to receive state licenses. An additional 29,000 farmers there haven’t bothered with the paperwork, according to the group.

Mendocino County Sheriff Tom Allman complained that local laws allowing cultivation are too “gentle” and attract violent crime, including a farmworker’s recent homicide.

In Siskiyou County, leaders declared a state of emergency and called on Gov. Jerry Brown to help with an influx of marijuana farmers, who have snatched up inexpensive land even though pot cultivation is illegal there. Two growers were arrested and charged with offering Sheriff Jon Lopey $1 million to leave their farms alone.

“That’s all you need to know about the type of money involved,” Lopey said. “This isn’t confined to the state. There’s a big market outside of California they are supplying.”

In Calaveras County, voters in January replaced four of the five supervisors who voted to legalize marijuana. The new majority has vowed to repeal legalization and institute a strict ban. But a formal vote has been delayed several times amid threats of lawsuits from farmers.

“So much of this is a cultural war,” grower Beth Witke said. “I’m tired of being demoralized by the ban supporters.”

Witke and other farmers argue they create good-paying jobs for young adults who otherwise would leave the county for the San Francisco Bay Area. She is among a handful of growers who operated quietly in Calaveras County for decades, attracted by the region’s climate and proximity to the Bay Area.

But the devastating 2015 wildfire helped launch the county’s green rush. The fire leveled subdivisions and wooded areas, turning them into attractive farmland. Former homeowners sold their flattened lots to outside growers armed with cash and betting the county would issue permits to grow.

Mark Bolger received the first permit. He said a ban would drive out him and his dozen workers.

“I’m trying to do the right thing,” Bolger said. “But the first guy through the door always gets shot.”

The sheriff said he’s focused on farmers who have never applied for a permit or who grow despite a rejected application. This year, he has raided about 40 farms and seized close to 30,000 plants.

In late September, deputies raided two farms that share a waterline west of Copperopolis and removed more than 300 plants. Three of the four farmers arrested were new arrivals from Minnesota. All four tended to another plot deputies raided in August.

They were cited and released. One of them — Ryu Lee, 22, of Redding — told deputies taking him to jail that he would return regardless of whether a ban was enacted.