U.S. Interior Department Bureau of Land Management acting director William Perry Pendley served unlawfully for 424 days without being confirmed to the post by the Senate as required under the Constitution, U.S. District Judge Brian Morris determined.

The ruling came after Montana’s Democratic governor in July sued to remove Pendley, saying the former oil industry attorney was illegally overseeing an agency that manages almost a quarter-billion acres of land, primarily in the U.S. West.

“Today’s ruling is a win for the Constitution, the rule of law, and our public lands,” Gov. Steve Bullock said Friday. Environmental groups and Democratic lawmakers from Western states also cheered the judge’s move after urging for months that Pendley be removed.