Boulder County’s ban on oil and gas development has gone on long enough, Colorado Attorney General Cynthia Coffman said Tuesday as she sued to end the block.

The lawsuit called the now 5-year-old series of moratoriums and extensions illegal and sets up a political battle between Republican Coffman and a group of Democratic lawmakers who say she is putting the interests of industry ahead of communities.

Boulder County officials called the lawsuit a waste of time and taxpayer money because they hope to have regulations in place by the end of March.

But Boulder County’s “open defiance of state law has made legal action the final recourse available,” Coffman said in a statement announcing her filing in Boulder County District Court.

First enacted in 2012 by Boulder County’s three elected commissioners, the ban on oil and gas development has been extended or renewed eight times.

Coffman’s office says some of those extensions were passed after the Colorado Supreme Court ruled in May that local governments cannot prohibit oil and gas development in conflict with the Colorado Oil and Gas Conservation Act, which regulates drilling statewide.

Attorney General Cynthia H. Coffman Files Suit Against Boulder County for Illegal Moratorium https://t.co/0i1XO0ygek — CO Attorney General (@COAttnyGeneral) February 14, 2017

The Supreme Court ruling led other communities to lift their similar bans, she said.

But Boulder County dug in. The county rescinded its 2012 moratorium, which was to expire in July 2018. County attorney Ben Pearlman said in a January letter to Coffman that the county felt regulations developed in 2012 did not adequately address the trend toward “mega-facilities” with 20 or more wells per pad. “In neighboring Broomfield, an operator is planning multiple well pads holding 40 wells,” he wrote.

The county adopted a new moratorium through Nov. 18, and directed staff to develop new rules. In December, the ban was extended to May 1, to give staff time to fine tune the rules, with a plan to present a final draft in a public hearing on March 14 and have them adopted by the end of the month.

But on Jan. 27, Coffman’s office warned the county that if it wasn’t in compliance by Feb. 10, she would take legal action.

Coffman’s office said Tuesday that “because five years is more than reasonable time to complete such a project, and because Boulder County continues to operate in clear violation of Colorado law, the attorney general today is filing suit in Boulder County District Court to compel compliance.”

Colorado attorney general files lawsuit against #Boulder County over the county's oil and gas development moratorium. Story coming soon — John Fryar (@jfryarTC) February 14, 2017

Boulder County in a statement called the Valentine’s Day lawsuit “a sweetheart deal for the oil and gas industry, but a massive waste of Coloradans’ tax dollars for the state to sue us on industry’s behalf.

“We are prepared to defend our right to safeguard the health, safety, and wellbeing of our constituents,” the statement said. “Boulder County understands its legal constraints on adopting local bans and lengthy moratoria; however, the current moratorium is of a materially shorter duration and is consistent with Colorado law.”

Deputy Boulder County attorney David Hughes told reporters Tuesday afternoon that his team is confident the current ban follows state law because the Colorado Supreme Court has upheld local governments’ short moratoriums.

“It’s hard to know exactly how this will play out,” Hughes said. The county has 21 days to respond to Coffman’s filing.

“We can’t really guess as to her motivations,” Boulder County commissioner Elise Jones said, calling Coffman’s lawsuit a waste of money and litigation since the county plans to have regulations in place so soon.

Coffman talked about the moratorium and her request for permanent injunction Tuesday morning with Jimmy Sengenberger on radio station KDMT in Denver.

“I suppose I could ignore fact that a local community is violating state law,” Coffman said on the program, “but I don’t think that’s a wise thing for me to do as attorney general.”

Some critics of Coffman’s position — including state Sens. Matt Jones, D-Louisville, and Steve Fenberg, D-Boulder, and state Rep. Mike Foote, D-Lafayette — have charged that she was acting on behalf of the oil and gas industry and that the industry could pursue legal action on its own. Coffman is seen as a potential candidate for governor in 2018

“Frankly, I don’t see why oil and gas companies should have to come into court to enforce state law,” Coffman said during the radio show.

Jones called the lawsuit disgraceful. “I think it’s safe to assume the attorney general is using the powers of her office and using tax dollars to intimidate and sue taxpayers at the behest of special interest industries.”

Foote said in a tweet Tuesday that we he “sad to see our Attorney General’s Office get co-opted by a private industry. It should protect communities, not sue them.” The filing also drew outrage from Conservation Colorado and U.S. Rep. Jared Polis, D-Boulder.

Sad to see our Attorney General's office get co-opted by a private industry. It should protect communities, not sue them. #coleg #copolitics — Mike Foote (@RepMikeFoote) February 14, 2017

The Colorado Oil & Gas Association lauded Coffman’s legal action.

“It’s not about drilling, or fracking, or pipelines, it’s about the law,” trade group president and CEO Dan Haley said in a written statement.. “And the law is clear: Long-term moratoriums — and this one is over five years now — are illegal. Boulder County shouldn’t be surprised that the attorney general cares about the rule of law in Colorado.”

Coffman’s legal action against a local government is not unprecedented. Her predecessor, John Suthers in 2014 fought to block Boulder County’s clerk and recorder from issuing same-sex marriage licenses.

The Times-Call contributed to this report.