The surge in domestic-energy production that has created millions of new jobs and abundant natural gas and oil is now facing a potential setback, with cities across the country imposing bans on the widely-used deep-drilling process known as fracking.

At least three U.S. cities and two counties in the November elections voted in favor of such a ban. And courts in Pennsylvania and New York have recently ruled in favor of letting cities have some control over the drilling.

There is little surprise that Texas is at the forefront of the fight between energy companies and other fracking supporters and critics who say the drilling process is noisy, pollutes water supplies and triggers earthquakes.

Most of the attention in Texas is now on Denton, a college town near Dallas that sits on the Barnett shale formation that is full of natural gas.

The city became the first in Texas to impose the ban and has emerged as a test case for municipalities across the state trying to halt the drilling -- particularly in the face of the powerful energy industry and the Texas General Land Office, which owns 13 million acres of land across Texas and uses revenue from the mineral rights to fund public education.

Denton residents approved the ban in a Nov. 4 referendum that promptly resulted in at least two lawsuits including one by the land office and the Texas Oil & Gas Association, an industry group.

The ban on fracking went into effect Tuesday, but the situation appears headed for a lengthy legal battle.

"Whatever happens next will take place in a courtroom," Ed Ireland, executive director of the Barnett Shale Energy Education Council, a group aligned with producers, told Reuters.

Property rights are a part of Texas' cultural fabric. But the desire to develop hydrocarbons such as oil and gas is equally powerful.

Another factor is that property rights are separate under state law from mineral rights, making it possible to own one but not the other.

The process of fracking involves shooting a mix of pressurized water, sand and chemicals to split rock formations and release the gas and so-called tight oil.

Fracking supporters say the industry in 2012 supported 2.1 million jobs across the country and contributed nearly $284 billion to the country’s Gross Domestic Product, according to most recent figures.

In Ohio, which is home to the Utica shale gas field and is enjoying a manufacturing renaissance as a result of fracking, the cities of Youngstown, Gates Mills and Kent on election day rejected proposed bans. However, the city of Athens approved one. They join the Ohio cities of Broadview Heights, Mansfield, Oberlin and Yellow Springs in the banning of fracking within city limits.

California voters in San Benito and Mendocino counties passed bans, while those in Santa Barbara defeated one. Santa Cruz County had already enacted one, and Los Angeles was already in the process of imposing a temporary ban. At least on local referendum has passed in Colorado, but the courts have ruled against it.

In Texas, the fight against fracking also pits municipalities against the Texas Railroad Commission, which governs the oil and gas industry.

"Regulation doesn't work very well in the state of Texas because the Railroad Commission doesn't work on the public's behalf," said Dan Dowdey, who is asking Alpine city commissioners to ban fracking in the nearby Permian Basin and Eagle Ford shale formations, though the closest drilling is more than 100 miles away.

And residents of Reno, which had its first recorded earthquake last year and hundreds since then, took their first step this past spring toward a ban. The ban limits fracking activities to operators who can prove the injections won't cause earthquakes.

Cities might never be able to prove definitively that fracking causes earthquakes.

Texas hired its first seismologist to investigate the potential link after Reno Mayor Lyndamyrth Stokes led an effort to get the Railroad Commission to halt the drilling in her area. Stokes say the seismologist told her that making such a definitive connection would be impossible.

On Monday, potential 2016 Democratic White House Candidate Hillary Clinton, who will need a domestic-energy platform, tried walking the narrow line between fracking supporters and critics.

“It is crucial we put in place smart regulations and enforce them including deciding not to drill when the risks to local communities, landscapes and ecosystems are just too high,” she told the League of Conservation Voters in New York. But “natural gas can play an important bridge role in the transition to a cleaner, greener economy.”

The Associated Press contributed to this report.