Sometimes you win by losing.

Take the ruling issued late Thursday night by a judge in Washington state. King County Superior Court Judge Hollis Hill denied a petition from eight young people asking the state to combat climate change by reducing its carbon dioxide emissions.

Hill explained in her written decision that as the students’ original legal action was already bringing about government action, a ruling in its favor was no longer needed.

That might seem like a big loss.

However, Hill agreed with the children's argument that the state “has a constitutional obligation to protect the public’s interest in natural resources held in trust for the common benefit of the people.”

The “very survival” of the young people who brought the lawsuit “depends upon the will of their elders to act now, decisively and unequivocally, to stem the tide of global warming,” Hill wrote, “before doing so becomes first too costly and then too late.”

RELATED: 4 Potential Impacts of the Groundbreaking Decision in the Dutch Climate Change Case

The children’s attorney is calling the ruling a win, on the whole. “It’s a very clear case of be careful what you ask for,” said Andrea Rogers of the Western Environmental Law Center. “We got the rule making we wanted, and that prevented us from getting the ultimate remedy we wanted in the case. But it didn’t stop the judge from giving us all of the judicial findings that we wanted her to make.”

Among its arguments against the lawsuit, the state claimed that its responsibilities to protect the public’s interest in the environment were limited to navigable waters and didn’t include the atmosphere. But Hill found that the condition of the two are inextricably linked. “Current science makes clear that global warming is impacting the acidification of the oceans to alarming and dangerous levels, thus endangering the bounty of our navigable waters,” she wrote.

The lawsuit has its roots in a petition filed with the Washington Department of Ecology in June 2014. In that petition, the eight children argued that state law required the department to regulate carbon emissions under the best available science and that it was not doing so.

Two months later, the agency rejected the petition, stating that the process under way for evaluating emissions cuts was sufficient.

In September the petitioners and Western Environmental Law Center, joined by a number of other nonprofit groups, filed an appeal. In December the Department of Ecology issued a report concluding that Washington state’s efforts to reduce emissions needed “to be more aggressive” and that existing reduction plans did not fully reflect current science. But nothing moved forward until June 2015, when Hill ordered the agency to reconsider the original petition.

Meanwhile, in July, the children met with Washington Gov. Jay Inslee, who ordered the agency to identify which parts of existing state regulation did not match the best current science and to write a new emissions reduction rule.

Hill’s ruling on Nov. 19 noted that Inslee’s orders made the original petition no longer necessary. But Rogers equated that ruling with similar rulings during the civil rights era. “Many, many court losses turned into big social change and social wins,” she said.

Rogers hopes this week’s ruling will inspire others around the country to continue similar legal efforts, including a case filed earlier in the year in which 21 young people sued the Obama administration over the slow pace of action on climate change.

“As long as we have government action moving forward to protect these kids’ rights and a judge acknowledging that those rights exist,” Rogers said, “it’s a new day, from our perspective.”