A group of youths were so worried about the future of climate change, they fought for the right to sue the US government - and won.

Oregon US district court judge Ann Aiken ruled in favour of the 21 young plaintiffs, aged between eight and 19, preventing courts from dismissing their case.

Some of the children were exposed to raw sewage in their homes in the wake of the Louisiana floods, the lawsuit alleged, while others have limited drinking water and food due to pollution, and their personal safety has been jeopardized by forest fires and flooding.

16-year-old plaintiff Xiuhtezcatl Martinez, youth director of Colorado-based nonprofit organization, Earth Guardians, said in a statement: "We’re doing what so many people told us we were incapable of doing: holding our leaders accountable for their disastrous and dangerous actions. I and my co-plaintiffs are demanding justice for our generation and justice for all future generations."

Now Juliana v United States, which alleges the government has exposed the youths to the dangers of climate change, will be allowed to proceed in 2017 and could end up in the supreme court.

"I have no doubt that the right to a climate system capable of sustaining human life is fundamental to a free and ordered society," the judge said.

10 photographs to show to anyone who doesn't believe in climate change Show all 10 1 /10 10 photographs to show to anyone who doesn't believe in climate change 10 photographs to show to anyone who doesn't believe in climate change A group of emperor penguins face a crack in the sea ice, near McMurdo Station, Antarctica Kira Morris 10 photographs to show to anyone who doesn't believe in climate change Floods destroyed eight bridges and ruined crops such as wheat, maize and peas in the Karimabad valley in northern Pakistan, a mountainous region with many glaciers. In many parts of the world, glaciers have been in retreat, creating dangerously large lakes that can cause devastating flooding when the banks break. Climate change can also increase rainfall in some areas, while bringing drought to others. Hira Ali 10 photographs to show to anyone who doesn't believe in climate change Smoke – filled with the carbon that is driving climate change – drifts across a field in Colombia. Sandra Rondon 10 photographs to show to anyone who doesn't believe in climate change Amid a flood in Islampur, Jamalpur, Bangladesh, a woman on a raft searches for somewhere dry to take shelter. Bangladesh is one of the most vulnerable places in the world to sea level rise, which is expected to make tens of millions of people homeless by 2050. Probal Rashid 10 photographs to show to anyone who doesn't believe in climate change Sindh province in Pakistan has experienced a grim mix of two consequences of climate change. “Because of climate change either we have floods or not enough water to irrigate our crop and feed our animals,” says the photographer. “Picture clearly indicates that the extreme drought makes wide cracks in clay. Crops are very difficult to grow.” Rizwan Dharejo 10 photographs to show to anyone who doesn't believe in climate change Hanna Petursdottir examines a cave inside the Svinafellsjokull glacier in Iceland, which she said had been growing rapidly. Since 2000, the size of glaciers on Iceland has reduced by 12 per cent. Tom Schifanella 10 photographs to show to anyone who doesn't believe in climate change A river once flowed along the depression in the dry earth of this part of Bangladesh, but it has disappeared amid rising temperatures. Abrar Hossain 10 photographs to show to anyone who doesn't believe in climate change A shepherd moves his herd as he looks for green pasture near the village of Sirohi in Rajasthan, northern India. The region has been badly affected by heatwaves and drought, making local people nervous about further predicted increases in temperature. Riddhima Singh Bhati 10 photographs to show to anyone who doesn't believe in climate change A factory in China is shrouded by a haze of air pollution. The World Health Organisation has warned such pollution, much of which is from the fossil fuels that cause climate change, is a “public health emergency”. Leung Ka Wa 10 photographs to show to anyone who doesn't believe in climate change Water levels in reservoirs, like this one in Gers, France, have been getting perilously low in areas across the world affected by drought, forcing authorities to introduce water restrictions. Mahtuf Ikhsan

The children want to act quickly. Court documents show they believe there is a "very short window to phase out fossil fuel exploitation and avert environmental catastrophe".

If the youths win, the case will be heralded as a major civil rights lawsuit and will mandate the government to come up with a science-based plan to majorly reduce carbon emissions.

The case could bring hope to millions of Americans who worry that president-elect Donald Trump will scrap funding for the Paris climate change agreement with the United Nations, halt renewable energy in the US and lift restrictions from the energy industry.

The lawsuit was filed, however, before Mr Trump was elected, and the US, president Barack Obama and “numerous executive agencies” from the department of defense to the department of agriculture were named as the defendants, who allegedly sacrificed longer term gains for short term profit.

The defendants have made decisions which have led to worsen climate change, the lawsuit alleges, destroying public assets like coastlines and violating their constitutional rights to life, liberty and property.