Want climate news in your inbox? Sign up here for Climate Fwd:, our email newsletter.

WASHINGTON — The Obama administration violated federal law by failing to adequately take into account the climate change impact of leasing public land for oil gas drilling in Wyoming, a federal judge ruled Tuesday.

But the decision by the United States District Court for the District of Columbia could also present a legal threat to President Trump’s agenda to quickly expand oil and gas drilling and coal mining across the nation’s public lands and waters. That’s because the decision amounts to a road map that could be used to challenge hundreds of Trump administration leases as well.

However, experts said that, while the decision could lead to legal delays for the drilling expansion envisioned by Mr. Trump by tangling them in litigation, it was unlikely to halt it entirely.

Tuesday’s decision by Judge Rudolph Contreras, which applied specifically to an Obama-era plan by the Interior Department’s Bureau of Land Management to lease several thousand acres of land for drilling in Wyoming, also concluded that the agency was legally required to consider the climate impact of all such lease sales for fossil fuel development.