MADISON, Wis. (AP) — A Wisconsin appeals court has upheld the state’s right-to-work law, reversing a Dane County circuit judge’s ruling striking it down.

The 3rd District Court of Appeals on Tuesday sided with Gov. Scott Walker and rejected the challenge brought by three unions.

Right-to-work laws prohibit businesses and unions from reaching agreements that require all workers, not just union members, to pay union dues. Unions challenged the law, arguing that it enables nonunion members to receive free representation. Wisconsin is one of 25 states with a right-to-work law.

Last year, Dane County Circuit Judge William Foust struck down the law as unconstitutional. But the appeals court says it is lawful.