BOISE, Idaho (AP) — A judge in Idaho has overturned a federal directive to curtail environmental review and eliminate mandatory public comment periods concerning oil and gas leasing on some public lands.

The U.S. magistrate judge vacated five oil and gas leases in Nevada, Utah and Wyoming, ruling the federal Bureau of Land Management failed to allow the public participation required by law, according to a statement by The Center for Biological Diversity.

The ruling Thursday was connected to a broader lawsuit challenging the Bureau of Land Management’s federal oil and gas leasing practices across 3,125 square miles (8,094 square kilometers) of greater sage-grouse habitat.

The ruling applied to lease sales in greater sage-grouse habitat across 104,688 square miles (271,141 square kilometers) in 11 Western states.

Future leases in greater sage-grouse habitat must allow a 30-day public comment and administrative protest period, the court ordered.

“This is an enormous victory for greater sage grouse and hundreds of other animals and plants that depend on this dwindling habitat,” Taylor McKinnon of the Center for Biological Diversity said. “The judge confirmed that it’s illegal to silence the public to expand fossil-fuel extraction.”