Brazil's government has been told that development projects, including hydropower dams, in protected areas can no longer go ahead without the prior approval of lawmakers.
Last week's ruling by the supreme court followed the use by the government in recent years of the controversial "provisional measure", a legal instrument that allowed the president to approve projects by reducing the size of protected areas.
Campaigners said the decision should ensure the country's forests and reserves, including the Amazon rainforest, were better protected.
"This decision puts an end to a spree of provisional measures in the name of environmental de-protection," said Mauricio Guetta, a lawyer at Instituto Socioambiental (ISA), an advocacy group.
In recent years, the government has used the measure to open up protected areas for controversial projects, including building two of Brazil's largest hydropower dams - the Jirau and Santo Antonio - in the Amazon.
The use of the measure to shrink protected areas with immediate effect had brought "irreversible consequences, irreversible damage to the environment," Guetta told the Thomson Reuters Foundation by phone.
The eight-judge bench ruled unanimously that using the provisional measure to reduce the size of protected areas for any reason was unconstitutional.
It followed a lawsuit in which the court heard the measure had been used in 2012 to allow trees in six protected areas of the Amazon to be felled to make way for five hydropower dams.
"The (provisional measure), later converted into law, reduced the level of environmental protection by deactivating due legislative process," supreme court justice Alexandre de Moraes said in a statement.
The court said the ruling would not affect the five hydropower plants in question because the provisional measure had already been enacted in law, and some are operating.
Guetta said the ruling meant any changes to protected areas must be first approved by law, and local communities should be properly consulted about projects planned on their land.
"The government has been trying to reduce by more than 1 million hectares the area under conservation in the southern part of Amazonas state. Now this initiative is officially vetoed because of the supreme court's decision," he said.
Environmentalists say increasing swaths of land, including the Amazon forest, are being felled for grazing and cropland, and for development projects.
Deforestation in the Amazon fell in the August 2016 to July 2017 monitoring period for the first time in three years, although the 6,624 square kilometers (2,557 square miles) cleared of forest remains well above the low recorded in 2012 and targets for slowing climate change.