The Colorado Court of Appeals sided with a group of teenagers Thursday, reversing a lower court and elevating protection of public health and the environment to “a condition that must be fulfilled” by the state before oil and gas drilling can be done.

The ruling by appeals court judges — in a case that drew heavy state and industry legal opposition — reinterprets the mission of the Colorado Oil and Gas Conservation Commission to require more than balancing industry interests with protection of people and the environment.

Colorado lawmakers created the COGCC to regulate oil and gas development, which has led to drilling more than 50,000 wells in the state, including thousands near people north of metro Denver and hundreds inside municipal limits in cities such as Erie and Greeley.

State lawmakers charged the COGCC with fostering “responsible, balanced” development, production and use of oil and gas “in a manner consistent with protection of public health, safety, and welfare, including protection of the environment and wildlife resources.”

For more than a decade, COGCC officials have interpreted this to mean balancing oil and gas industry interests against public health, safety and welfare.

This case arose in 2013 when Xiuhtezcatl Martinez of Boulder and other teenagers asked the COGCC to consider a new rule. They proposed that Colorado not issue any new permits for oil and gas drilling “unless the best available science demonstrates, and an independent third party organization confirms, that drilling can occur in a manner that does not cumulatively, with other actions, impair Colorado’s atmosphere, water, wildlife, and land resources, does not adversely impact human health and does not contribute to climate change.”

In 2014, the COGCC held a hearing on that request and then denied it, saying such a rule contradicted and was beyond COGCC authority.

The teenagers, with more than a dozen advocacy groups supporting them, appealed. The state Denver District Court ruled in favor of the COGCC and Colorado Attorney General Cynthia Coffman. And the teenagers appealed again, arguing that District Judge Eric Elliff misinterpreted the plain language of lawmakers’ mandate to the COGCC and, therefore, erred in denying the proposed rule on drilling.

On Thursday, the three-judge appeals court panel agreed. The COGCC mandate “was not intended to require that a balancing test be applied. … Rather, the clear language (of the agency’s enabling legislation) … mandates that the development of oil and gas in Colorado be regulated subject to the protection of public health, safety, and welfare, including protection of the environment and wildlife resources.”

The ruling does not mean the COGCC now must adopt the teenagers’ proposal to restrict new drilling. It means the COGCC illegally rejected it and sends the case back to district court.

““We disagree with the majority and believe the District Court and the dissenting opinion have it right,” said COGCC spokesman Todd Hartman. “We are evaluating whether to appeal this decision to the Colorado Supreme Court.”

The environment advocacy group Earthworks lauded the ruling as backup for towns and cities weighing measures to increase protection of health and the environment.

“This shifts health, safety and welfare concerns above development-as-usual permitting,” Earthworks energy program director Bruce Baizel said. “Now the state of Colorado, after removing communities’ power to ban fracking and drilling themselves, might have to effectively ban fracking inside cities to protect residents’ health.”

Colorado Oil and Gas Association officials did not immediately comment on the ruling.

The appeals court ruled amid continuing discord over fossil fuel production, despite intervention by Gov. John Hickenlooper and comprehensive state rules designed to bring harmony.

State officials have sued cities that banned oil and gas drilling inside municipal limits. On Thursday, Boulder County’s commissioners adopted a new set of regulations for oil and gas development on unincorporated land.

Boulder County officials said this was a matter of using local land use authority to protect public health and the environment.

AG Coffman in February filed a lawsuit challenging Boulder County’s series of moratoriums on oil and gas development, and commissioners on Thursday expressed frustration that state law preempts local control over aspects of oil and gas development.

“While we wish we could completely control or prevent all aspects of oil and gas development within Boulder County,” commissioner Elise Jones said, “we are doing everything we can under the current law to protect our local air, water, public health, and the environment with these new regulations.”