(Reuters) - Colorado voters on Tuesday rejected a measure calling for greater distances between oil and gas drilling and public spaces, a move opponents said would have sharply limited new wells in the fifth-largest oil producing state in the nation.

FILE PHOTO: An oil well pump jack is seen at an oil field supply yard near Denver, Colorado, U.S., Feb. 2, 2015. REUTERS/Rick Wilking/File Photo/File Photo

The measure was defeated in an election that saw oil companies pour millions of dollars into efforts to combat the proposal and was one of several ballot initiatives that sought to curb fossil fuels use.

Shares in producers active in the state gained ground on Wednesday, including Anadarko Petroleum Corp APC.N, which rose 5.7 percent, and Noble Energy Inc NBL.N, which climbed 4.2 percent. The two stocks had fallen sharply after the initiative went on the state's ballot.

Known as Proposition 112, the measure would have mandated at least 2,500 feet (762 m) of separation between new drilling activities and occupied areas or those deemed to be vulnerable. It garnered 43 percent of votes, according to final data from the Colorado Secretary of State’s office. Passage required a majority of ballots cast.

Opponents said the measure would have cost Colorado’s economy between $169 billion and $217 billion over 12 years, and would have cut state and local tax revenues by $7 billion to $9 billion. Oil production in the state was up 26 percent year-over-year to 477,000 barrels per day, according to the latest U.S. government figures.

“This measure was an extreme proposal that would have had devastating impacts across the state on jobs, education and numerous other programs,” said Chip Rimer, a senior vice president at Noble and chairman of the Colorado Oil & Gas Association.

Municipal officials, including Denver Mayor Michael Hancock, urged voters to reject the measure, warning that it would hurt jobs and reduce tax revenues for schools, roads and public safety.

The rejection was another setback for environmentalists who in 2016 failed to get a similar initiative placed on the ballot.

Colorado Rising, an anti-fracking group that helped get the measure on the ballot, was vastly outspent but campaigned door-to-door and used phone and text messages to sway voters.

“The outcome does not change the fact fracking operations are dangerous and should not be happening so close to Colorado homes, schools and drinking water,” said Colorado Rising’s Russell Mendell.

The group would re-evaluate next steps in the coming days, Mendell said on Wednesday.

Ahead of Tuesday’s vote, energy executives warned passage ultimately could lead them to reduce drilling in the state, although several said they expected no immediate impact.