DETROIT (AP) — A judge has blocked a sudden ban on the open display of guns near Michigan polling places on Election Day.

Judge Christopher Murray acted Tuesday, just a few hours after hearing a challenge from gun-rights groups.

They said Secretary of State Jocelyn Benson, a Democrat, had exceeded her authority in banning people from openly carrying guns within 100 feet of polling places.

Critics argued that Benson failed to go through a formal rule-making process as required under state law.

The judge agreed. Attorney General Dana Nessel pledged to appeal Murray’s decision with just days left until the election.