SOUTH DAKOTA -
In a measure the state said would help stop massacres like the one at Sandy Hook Elementary school in Connecticut in December, so-called "school sentinels" will be tasked with protecting children.
The controversial measure was signed by Governor Dennis Daugaard, a Republican, and will go into effect on July 1.
It reflects a growing divide between those including President Barack Obama, who believe guns need to be more strictly regulated, and supporters of the National Rifle Association who argue that more guns keep people safer.
In South Dakota, supporters of the "sentinel" plan argued that schools in rural areas were too isolated to expect immediate help from police in the event of an attack.
They could not afford to pay full time security officers to protect them, so they want to arm teachers and volunteers.
Republican state senator Craig Tieszen, a former police chief, said: "If we think we're immune in South Dakota from school violence, we should probably think again. As trite as it sounds, the best way to stop a bad guy with a gun is a good guy with a gun."
The measure was opposed by several representatives of school boards and teachers who said it could lead to accidental shootings and the arming people who were not properly trained.
Jeff Marlette, a school district superintendent, said it sent a message that "our state has gotten so bad and so unsafe and so dangerous that we must now attend school in an armed fortress."
Under the new law school districts will decide in a public meeting whether to arm teachers. Residents will be able to force a public vote if they disagree with the decision. Teachers will not be forced to carry a weapon against their will and will receive firearms training.
Mr Daugaard said: "I think it does provide the same safety precautions that a citizen expects when a law enforcement officer enters onto a premises."
Karl Kroger, a parent in Pierre, South Dakota, told a local television station: "As a father of a newborn, beautiful girl, the last thing I want to do is send her to a school where I know, or don't know, who in the heck is going to be having a gun in that school."