MADISON, Wis. — A judge ruled Thursday that Republican leaders of the Wisconsin Legislature illegally hired private taxpayer-funded attorneys to represent them in anticipation of lawsuits over redistricting.

The lawsuit filed by attorney Lester Pines on behalf of four Madison teachers, including the current and incoming teachers union president, argued that state law does not allow for legislative leaders to hire attorneys outside the state Department of Justice before a lawsuit has been filed. The Legislature has yet to begin the redistricting process and there are no pending lawsuits.

Assembly Speaker Robin Vos and Senate Majority Leader Devin LeMahieu entered into contracts in December and January with two outside law firms to handle the redistricting process, including any future lawsuits. The contracts allowed for spending of more than $1 million in taxpayer money to the two law firms.

Dane County Circuit Judge Stephen Ehlke ruled Thursday that the contracts are void because Vos and LeMahieu were not authorized to hire the law firms.

The Republican leaders hired attorneys Adam Mortara and Consovoy McCarthy with a Washington-area law firm that represented former President Donald Trump and the Republican National Committee.

Under that contract, the state began paying $30,000 a month starting in January to cover consulting.