The Colorado Supreme Court struck down attempts by two cities to ban or delay fracking on Monday, a major victory for the oil and gas industry.

The court ruled that a ban on fracking in Longmont and a five-year moratorium in Fort Collins are invalid because they conflict with state law. State officials and the industry argued the state has the primary authority to regulate energy, not local governments.

The courts may not have the final say, however. Fracking critics hope to get at least five measures on the November ballot to amend the state Constitution to restrict the industry or allow local governments to do so.

The industry has said it will fight those proposals.

The cases before the Supreme Court were an outright ban on fracking approved by Longmont voters in 2012 and the moratorium imposed by Fort Collins voters in 2013. The oil and gas industry sued both cities and lower courts threw out the ban and moratorium.

The cities appealed and the cases were put on a fast track to the Supreme Court.

The Colorado decision has no direct effect outside its borders because oil and gas regulation is largely left up to individual states. New York has banned fracking, while lawmakers in Texas and Oklahoma have blocked local governments from imposing bans. In California, Gov. Jerry Brown appointed a panel to study the issue.

Fracking, or hydraulic fracturing, has long been a contentious issue in Colorado, the nation's No. 7 energy-producing state.

Fracking injects a high-pressure mix of water, sand and chemicals underground to crack open formations and make it easier to recover oil and gas.

Combined with other drilling techniques, it opened up previously inaccessible oil and gas reserves and boosted the economy, although low oil prices have led to widespread layoffs and a steep decline in drilling.

Critics worry about danger to the environment and public health from spills and leaks. Others say around-the-clock noise, lights and fumes from drilling rigs make their homes unlivable as oilfields overlap with growing communities.

The industry says fracking is safe and that drilling companies take steps to minimize the disturbances.

Colorado regulators approved new rules earlier this year intended to ease the conflicts by giving local governments the right to consult with energy companies on the location of multiple-well drilling sites and other big facilities.

But the rules generally don't allow governments to set their own regulations. Many critics of the industry say that's what is needed to protect property values, peace and quiet and public safety.

The industry said the new rules went too far.

The Legislature has mostly stayed out of the issue this year, waiting for the Supreme Court's decision.