BAKERSFIELD, Calif. — Kern County is not exactly the kind of place where you would expect a voter rebellion, what with its conservative rural residents, its live-off-the-land values and its almost unshakable devotion to the Republican Party.

But over the last several months, Kern County — about 100 miles north of Los Angeles and as far as it can get from San Francisco — has become the scene of a civil war of sorts over an issue, medical marijuana, whose supporters are often of a more liberal stripe. At stake is a controversial law — passed unanimously in August by the county’s all-Republican Board of Supervisors — which would have effectively shut many of the three dozen or so medical marijuana dispensaries in the county.

But a funny thing happened on the way to the ban: medical marijuana advocates started a petition drive to challenge it, calling for a referendum on the law, something that could happen as soon as next year. In the meantime, the law is in limbo.

And while such an effort is nearly unheard of in Kern — perhaps the first time in modern memory that anyone can recall a county law being so challenged — it is not the only place in California, the original medical marijuana state, where local regulation is meeting opposition. Laws passed in several other counties and cities have also been the subject of referendum movements, something permitted by California state law.