The Australian Workers' Union (AWU) has welcomed the Federal Court's rejection of a legal challenge against forestry in NSW.
The Environmental Defenders Office and North East Forest Alliance on Wednesday lost a legal challenge of a Regional Forest Agreement between the NSW and federal governments.
Thousands of workers' jobs were at risk if the EDO was successful as it could have led to the suspension of forestry in NSW, Victoria, Tasmania and WA.
Justice Melissa Perry found intergovernmental forestry agreements should be matters for elected governments rather than courts to decide.
AWU National Secretary Paul Farrow said the ruling was a major win for workers.
"This reckless legal challenge could have risked thousands of workers' livelihoods by bringing an entire industry to its knees," he said.
"It's clear the Environmental Defenders Office and its allies couldn't care less about all the men and women who rely on forestry to put food on the table.
"This ruling will be a massive relief for workers and their families not only in NSW but all the other states which could have suffered from the opposite outcome.
"Australia is in the worst housing crisis in living memory yet the EDO wanted to disrupt the supply of the material used in most house frames.
"Thankfully, the court's decision means industry won't be sidelined from helping to solve the housing crisis which is a win for the entire country.
"Regional communities across the country will be breathing because this also means critical hazard reduction activities won't be disrupted at the height of the most dangerous fire season in years.
"The forestry industry needs a sensible and productive path forward that is determined by careful deliberation informed by workers, industry and other genuine stakeholders, rather than disruption by outside interests."