(Reuters) - A group of young Americans suing the federal government over lack of action to fight climate change can proceed with their lawsuit, but U.S. President Donald Trump cannot be named as a defendant, a federal judge ruled on Monday.

An U.S. flag waves in the wind on a boat near the Statue of Liberty in New York August 31, 2011. REUTERS/Lucas Jackson

The decision by U.S. District Judge Ann Aiken in Eugene, Oregon, came before the case is scheduled to go to trial in federal court on Oct. 29.

Twenty-one children and young adults, who were between 8 and 19 years of age when the lawsuit was filed in 2015 against the Obama administration, accused federal officials and oil industry executives of violating their due process rights by knowing for decades that carbon pollution poisons the environment, but doing nothing about it.

Aiken said the case revealed a delicate balance of power between the judicial and other government agencies. The judge said those concerns were not enough to warrant a dismissal of the entire case, but she concluded that the inclusion of Trump as the sitting U.S. president violated the proper separation of powers.

The original lawsuit had named President Barack Obama as a defendant. After Trump took office, the lawsuit was amended to instead name Trump as a defendant.

The lawsuit still includes the heads of other U.S. agencies. The names of the heads of those agencies were also amended with the change to the Trump administration.

The potentially far-reaching case is one of a handful seeking to have courts address global warming and its causes.

The U.S. Justice Department said it was reviewing Monday’s decision and in a statement called the lawsuit an unconstitutional attempt to control the entire country’s climate and energy policy through a single court.

A spokeswoman for the plaintiffs did not return a request for comment on Monday’s decision.

The federal government in a court filing on Friday asked the 9th U.S. Circuit Court of Appeals to halt the case while it is seeking review by the U.S. Supreme Court.

The plaintiffs say in the lawsuit that extreme weather events, such as flooding, caused them emotional trauma and damage to their health, safety, cultural practices, food security and economic stability.

The government argued those injuries are widespread environmental phenomena affecting all other people on the planet and said the issue did not belong in court.

The federal defendants also contended that letting the case proceed would be too burdensome, would unconstitutionally pit the courts against the executive branch, and would require improper “agency decision-making” by forcing officials to answer questions about climate change.

Aiken in her Monday decision rejected those arguments, saying the plaintiffs had offered extensive expert declarations to link their injuries to fossil fuel-induced climate change.

She also said there was sufficient evidence that government actions, such as coal leasing, oil development and fossil fuel industry subsidies, led to the children’s injuries.