Spain, battling a deep recession and high unemployment, imports about 76% of its energy needs and the technology to extract shale gas, known as fracking, could help relieve its foreign dependence on oil, coal and gas.
Early estimates indicate Spain has large shale gas reserves, but environmentalists have voiced concerns over the safety of the technique, which involves injecting water and chemicals at high pressure into underground rock formations.
Cantabria's ruling People's Party (PP), which has an absolute majority in the regional parliament, proposed the law to ban the practice.
The bill passed with support from all political parties in the Cantabrian parliament on Monday afternoon. The Cantabrian parliament said on its Twitter feed: "Unanimous. Law to ban hydraulic fracturing approved."
"In Cantabria, there is a very large social movement against fracking ... the bill will be passed unanimously by the three parliamentary groups. The region is very small and highly populated," a PP source told Reuters earlier on Monday.
However, at a national level, the PP has voiced support for hydraulic fracturing as long as it complies with environmental rules. The ruling PP, which controls the Spanish parliament, could seek to appeal or overturn Cantabria's ban.
Experts say if it is done according to best practice it is environmentally safe, but the technology still evokes much public concern, especially in Europe.
Promise of low-cost energy
In the United States, shale gas has helped transform the energy market by lowering gas and coal prices, which are in turn helping to lure gas-intensive industries such as petrochemicals back to home soil thanks to the abundance of low-cost energy.
But in Europe, it has made far slower progress and has met with environmental concerns that have triggered bans on fracking in France and Bulgaria.
Shale Gas Europe, a lobby group, says Spanish shale gas reserves are among the biggest in the world.
"Spain's significant reserves, if technically recoverable, will transform its economy at a time when the country is struggling with a burgeoning debt and has been forced to adopt austerity measures," the group says.
Although there are no reliable data available, some analysts say Spain's shale gas reserves could be as high as 1.4 trillion cubic metres, enough to cover European Union demand for around three years.
Early estimates have, however, proven unreliable in other cases.
Poland, which had hoped to be sitting in some of Europe's biggest reserves, had to slash its initial estimates by 90% last year after detailed follow-up surveys and drillings disappointed.