JACKSON, Miss. (AP) — A majority of Mississippi Supreme Court justices ruled Thursday that some local judges were wrong to ban people with enhanced concealed-carry licenses from taking guns into courthouses.

The high court said judges in the 14th Chancery District overstepped their authority because the Mississippi Constitution specifies that only the Legislature "may regulate or forbid carrying concealed weapons."

The Legislature enacted a law in July 2011 saying that people with enhanced concealed-carry licenses may take guns into courthouses but not into courtrooms.

In November 2011, judges in the 14th Chancery District issued an order banning anyone other than law enforcement officers from having concealed guns in and around all parts of courthouses in the district in Chickasaw, Clay, Lowndes, Noxubee, Oktibbeha and Webster counties.

A resident with an enhanced concealed-carry license, Ricky Ward, challenged the chancery judges' ban.

The chancery judges responded by writing that courthouses can be places of high emotion, with people going there for divorces and child custody cases. They wrote that it is reasonable to consider a courthouse hallway to be an extension of a courtroom and that it is "ludicrous to assume that people in heightened states of emotional upheaval would pause to decide where in the building they can be mad and where they cannot."

The chancery judges also wrote that most confrontations in the courthouses had occurred outside of courtrooms.

Mississippi Attorney General Jim Hood and the National Rifle Association submitted court papers opposing the chancery judges' ban on concealed weapons throughout the courthouses.

A local attorney who practices in chancery court wrote a brief supporting the ban, as did some other chancery and circuit judges.

People holding enhanced concealed-carry licenses must state on their applications that they do not have felony records and that they are physically and mentally healthy.

In a dissenting opinion Thursday, Justice Leslie B. King wrote that the Mississippi Constitution specifies that the administration of justice is only a function of the judicial branch of government.

"That function and that obligation both extend beyond the four walls of the courtroom," King wrote.

While other justices found that the chancery judges had violated the separation of powers between the judicial and legislative branches of government, King found that legislators had done so by enacting a law that allows concealed weapons in most parts of courthouses.

MORE: See the entire ruling here