The Mississippi Supreme Court on Thursday unanimously upheld the state’s open carry-gun law, allowing it to take effect after a circuit judge’s order had kept it on hold about two months.

“This court now finds that the circuit judge erred as a matter of law when he found House Bill 2 to be vague and, therefore, unconstitutional. He also erred when he stated that a ‘reasonable person reading the bill could not discern what the law allows and what it prohibits,’” according to the ruling signed by Justice Randy Pierce.

Earlier this year, legislators passed and Gov. Phil Bryant signed the bill that says adults don’t need a permit to carry a gun that’s not concealed.

Several officials, including the Hinds County district attorney, sued to block the law, saying there could be chaos if people were openly carrying guns in public places. Circuit Judge Winston Kidd put the measure on hold just before it was to become law July 1.

After hearing arguments, Kidd issued an injunction July 12, saying the law was on hold until the Legislature can clarify it.

Justices overturned Kidd’s injunction Thursday. They made the ruling based on written arguments filed by opponents and supporters of the law; they did not hear oral arguments.

The main sponsor of House Bill 2, Republican Rep. Andy Gipson of Braxton, said Thursday that he’s pleased with the justices’ unanimous ruling.

“It just confirms, in a very real sense, the right to keep and bear arms,” Gipson told The Associated Press.

Attorney General Jim Hood, a Democrat, defended the open-carry law in court. Hood issued a nonbinding legal opinion June 13 that says guns can still be banned in courthouses and other public buildings. At many places, including the Capitol and in public parks, officials have posted signs to show that weapons are prohibited.

Opponents of the open-carry gun law say it has caused confusion about where people may carry guns that aren’t concealed. They also say it could put law enforcement officers in danger if people with no training are carrying guns.

Republican Bryant, like many supporters of the law, has said it restates the right to bear arms that’s in the Mississippi Constitution.

Even with the open-carry law taking effect, a previous law bans guns on school and college campuses. Bryant has said he has no argument with guns being banned in government buildings.

Many counties and cities have implemented bans of openly carried guns in public buildings.