The Iwerekan community of Delta State in the southern wetlands region had argued that flaring, or burning off gas associated with the extraction of crude oil, breached their right to life, dignity and a healthy environment.
"The court upheld all the points made by the community," said Nnimmo Bassey, director of Environmental Rights Action, a Nigerian campaign group that supported the legal case brought by the community in the delta city of Benin.
Gas is flared in the Niger Delta because of a lack of facilities to exploit the resource commercially. Giant orange flares burn around the clock in the vast region of mangrove swamps and creeks, many close to villagers' homes.
"It's a thing that goes on 24 hours a day, every day of every year. It causes explosions, constant noise and great heat. Many people have never had a time of quietness or a dark night because of these flares," Bassey told Reuters by telephone.
Bassey said Monday's ruling was against the government, state oil company Nigerian National Petroleum Corp. (NNPC) and the Nigerian arm of Royal Dutch Shell, which is one of five foreign oil firms that operate joint ventures with NNPC.
Activists say flaring makes
Nigeria a top African polluter
A spokesman for Shell declined immediate comment, while no one at NNPC could be reached.
Environmental group Friends of the Earth says more gas is flared in Nigeria than anywhere else in the world and Nigerian flaring causes more greenhouse gasses than all other sources in sub-Saharan Africa combined.
Environmentalists say flaring poses a health risk for people who live nearby. They say respiratory diseases such as asthma are rife in Niger Delta communities affected by flaring.
They also say pollution from flaring damages livelihoods by reducing crop yields.
"It causes explosions, constant noise and great heat. Many people have never had a time of quietness or a dark night because of these flares"
Environmental Rights Action
The government has set a 2008 target to extinguish flares, encouraging companies to use the gas for export as well as power generation within Nigeria.
Companies say projects are under development that will eventually enable them to stop flaring.
But Shell said in May it would miss the 2008 target because of funding problems and expected to stop continuous flaring in 2009.
"We are asking them to stop sooner than that. This (ruling) has put a very clear demand on government and the companies. We are hopeful that they will respect the rule of law," said Bassey.