Both judges ruled that, in essence, local governments couldn’t ban fracking because it’s a critical technology used by the energy industry to produce oil and natural gas, and it's the state that oversees oil and gas operations.

Mallard, in her ruling Wednesday regarding the Lafayette ban, wrote that “Lafayette does not have the authority, in a matter of mixed state and local concern, to negate the authority of the state. It does not have the authority to prohibit what the state authorizes and permits.”

The three cities had been sued by the Colorado Oil and Gas Association (COGA), an industry trade group.

After the Lafayette ruling, Tisha Schuller, COGA’s president and CEO, said she hoped Mallard’s ruling “ends the activist effort to pass illegal bans against energy development.”

“The bans have been unnecessary, divisive and costly for taxpayers,” Schuller said.

“Now that all three legal cases have been decided, we look forward to putting the ban debate behind us and focusing on meaningful solutions with our communities,” she said.

Fracking, short for hydraulic fracturing, pumps water, sand and chemicals under high pressure into rock formations thousands of feed underground, cracking them to allow the oil and gas to flow through the cracks into wells.

The technique is credited with a boom in U.S. oil and gas production — and has been targeted by environmental groups and communities who worry about harm caused by drilling and producing the commodities.

The rulings on the Longmont, Lafayette and Fort Collins cases leave two remaining city-wide fracking bans still standing: in Boulder and Broomfield.

Boulder hasn’t had a legal challenge to its five-year ban on fracking, approved by voters in 2013, according to a city spokeswoman.

The city of Boulder’s ban on fracking lifts in 2018, but the city doesn’t have any active wells, according to the city.

Broomfield’s ban, approved by voters in 2013, is in court, said Broomfield city attorney Bill Tuthill.

Broomfield was sued by Sovereign Operating Co. during the second quarter 2014, he said.

The company is arguing that its “memorandum of understanding” with the city, an agreement that allowed the company to move forward with drilling and fracking operations, predates and supersedes the voter-approved ban, Tuthill said.

“They’re arguing that [the ban] doesn’t apply to them,” Tuthill said.

The city’s stance is that the agreement contains language that makes the agreement subject to future changes in law, Tuthill said.

“This is precisely the kind of future change that they bargained for, and we’re arguing that they agreed to be bound by regulatory changes that might occur in the future,” Tuthill said.

Another suit, this one between the Longmont and the state’s oil and gas regulatory agency, the Colorado Oil and Gas Conservation Commission (COGCC), was withdrawn by the state as part of a larger deal that was cut to avoid a series of ballot issues focused on the energy industry being placed before voters this fall.

The suit between the COGCC and Longmont focused on the city’s 2012 oil and gas regulations, which the state believed stepped on the state’s authority to oversee drilling and production operations.