Colorado, having developed a reputation as a Mecca of sorts for legalized marijuana, is not the cheapest place to produce crude oil in the country. However, the state is proving resilient in the face of a protracted price slump and challenges to the fossil fuel industry. A U.S. drilling recovery is under way following a modest rebound in oil prices from 12-year lows last year. This has improved the prospects for U.S. shale drillers, who must pummel underground rock formations with water, minerals and chemicals to free oil and gas.

The Centennial State offers a view into how the recovery is playing out beyond the Permian Basin, the Texas and New Mexico region where drillers have flocked to take advantage of the nation's lowest-cost shale output. In Colorado it's not a flood of new shale players that are underwriting the rebound, but a group of entrenched oil-and-gas exploration and production companies, such as Noble Energy, Anadarko Petroleum, PDC Energy and SRC Energy, that specialize in drilling the state's rock. These drillers are devoting funds to their best acreage, leveraging the know-how they've cultivated over years of operating in Colorado to drive down the cost of producing oil and gas in a tough price environment. PDC Energy, for example, has focused on its prime holdings in Colorado's Wattenberg and continued to refine its methods, said Brian Velie, an equity analyst at Capital One Securities. The driller asserts it can now grow oil production by about 20 percent a year even with oil prices at $40 a barrel, less than half their 2014 peak. That's without growing its debt load too far beyond earnings before certain expenses — a key measure of financial health in the oil industry.

While oil and gas is a very important component of our economy, we don't rise and fall based on the price of oil or the price of gas. JJ Ament CEO of Metro Denver Economic Development Corp.

"Even under such a miserable macro environment, they can still post some growth and not lever up to do so," he said. While PDC entered the Permian last year, it also plans to sell its assets in the northeastern Utica Shale to focus on its core acreage in Wattenberg and Texas. To be sure, Colorado has not emerged from the downturn unscathed. The state's crude oil output fell last year by 8.6 percent, the first annual decline since 2001. Employment dropped nearly 5 percent. That's a big hit because the fossil fuel industry directly employs about 45,000 people in Colorado, and many of the jobs are high paying. The average annual salary was $107,000 in 2015, with state payrolls totaling nearly $5 billion.

Fortunately, Colorado has a diverse economy, and it is far less reliant on taxes from the oil and gas industry to balance its budget than other oil-producing states, like Alaska, Wyoming and North Dakota. More from Top States for Business

Appalachia joins the race for the multibillion-dollar petrochemicals boom

America's Top States for Business in 2017 That is by design, with efforts to reduce Colorado's reliance on oil dating back to the 1980s oil bust, said JJ Ament, CEO of the Metro Denver Economic Development Corp. "While oil and gas is a very important component of our economy, we don't rise and fall based on the price of oil or the price of gas," he told CNBC. Still, Colorado's fossil fuel industry generates about $10 billion in economic activity, and it's a critical job creator, particularly in rural areas, according to Ament. So the state is watching the recovery closely.

Energy industry prospects

Oil production has been ticking back up in Colorado this year. The U.S. Energy Information forecasts continued growth in the Niobrara Formation, which underpins much of Colorado's production, at least through July. But industry watchers shouldn't expect Colorado to post the same growth the Permian is seeing, said Raoul LeBlanc, oil and gas analyst at IHS Markit. The rebound is likely to be slow and steady and driven by companies whose U.S. portfolios are skewed toward Colorado. "A lot of it depends on the players that are there and to what degree they're dependent on that play," he said.

The center of Colorado's shale oil drilling is the Denver-Julesburg Basin. The top-tier assets are concentrated in the Wattenberg Field, just north of Denver in Weld County, which produced 85 percent of the state's crude oil in 2014, according to the Leeds School of Business at the University of Colorado Boulder. Drillers in the D-J Basin can break even with oil prices at about $40 to $42 a barrel, according to Ponderosa Advisors, a Denver-based energy advisory firm. While that's competitive with top-tier acreage in other oil-producing regions, it ranks at the bottom of the list, said Ponderosa CEO Porter Bennett. Drillers in the Permian Basin are looking at break-evens in the low $30s. In Oklahoma's emerging Scoop and Stack plays, break-evens for prime assets are in the mid-$30s. North Dakota's Bakken boasts break-evens in the high $30s. "Relative to other parts of the country, I'm not sure that it's attractive enough to warrant people to come here that haven't already established a base," said Bennett. Much of the dealmaking in the D-J Basin in past years has been among companies established in Colorado that aim to consolidate their existing positions, said Velie, the Capital One Securities analyst. These transactions help oil firms assemble larger blocks of land, allowing them to drill longer horizontal wells and streamline oil shipments, he explained.

Since 2014, Colorado has generated $8 billion in oil and gas deals, just 3 percent of the U.S. total, according to Houston-based oil-and-gas research firm PLS. Still, all the Permian land-buying is creating opportunities in other plays, according to Brian Lidsky, managing director at PLS. The companies that scooped up acreage in the Permian are now focused on implementing their plans, and they'll need money to do it. Many are selling off parts of their portfolio to generate cash, creating buying opportunities in Colorado, North Dakota, Oklahoma and Wyoming. The higher cost of producing oil in Colorado compared with other areas is a challenge for deal-making in the state, Lidsky said. "In addition, while difficult to quantify, there is also a perceived regulatory risk in Colorado with regard to the public's support of horizontal oil-and-gas development activities," he said.

More regulations?

Some analysts worry that drillers in Colorado could face higher regulatory costs following a deadly explosion at a home north of Denver, which was traced to an abandoned natural gas well drilled by Anadarko Petroleum. Gov. John Hickenlooper responded by ordering companies to inspect and test their flow lines situated within 1,000 feet of buildings. Oil analysts at investment banking firm Stifel said in May they expect greater regulation of flow lines and increased oversight following the tragedy.