PIERRE, S.D. — South Dakota lawmakers rejected a bill Tuesday that would have kept people who have been involuntarily committed to a psychiatric hospital and deemed a danger to society from owning guns.

The House and Human Services Committee voted 7-5 against the bill after voting 6-6 initially.

The measure would have prevented people from buying or possessing guns if they have been involuntarily committed to a facility for treatment of mental illness and found to be a danger for others. The names of such people would have been added to a national database that is checked when someone tries to buy a gun.

Some committee members said they were reluctant to take away the constitutional right to bear arms from those suffering from mental illness.

Rep. Melissa Magstadt, R-Watertown, said the measure would let an appointed county Board of Mental Illness decide whether people should lose their right to own guns. Anyone convicted of a violent crime is already forbidden owning or buying a gun, she said.

“It just might be a little too overreaching,” Magstadt said of the bill.

But Rep. Steve Hickey, R-Sioux Falls, said he thought the bill should be debated by the full House.

“I think we’re irresponsible if we identify dangerous people and we don’t monitor them,” Hickey said.

The bill’s main sponsor, House Democratic Leader Bernie Hunhoff of Yankton, said South Dakota is one of about 19 states that do not submit information about dangerous mentally ill residents to the National Instant Criminal Background Check System, a registry that is checked when someone tries to buy a gun. South Dakota now sends information that includes the names of people ineligible to buy guns because they have been convicted of violent crimes, he said.

Hunhoff said a modified version of the bill was crafted by lawmakers and representatives of the court system, sheriffs and the attorney general’s office. He said mentally ill people who have been declared dangerous to others should not have guns.

“Our rights tend to stop when they start to affect others,” Hunhoff said.

Under the bill, the state would have submitted people’s names to the federal registry after a county board of mental illness had committed them to a psychiatric treatment facility or the state Human Services Center and determined that they were a danger to others. Upon release, people could petition a judge to have their names removed from the federal registry.

Phyllis Arends, executive director of the South Dakota chapter of the National Alliance on Mental Illness, opposed the bill, saying it would unfairly label all mentally ill people as dangerous. There is no evidence such a list would prevent use of guns in crimes, and money should instead be spent to provide treatment to those with mental illnesses, she said.

“I’m here to remind you we’re talking about real people,” Arends told the committee.

Yankton lawyer David Hosmer, who frequently represents people referred for involuntary commitment to the Human Services Center, said the bill was narrowly written to deal only with those found to be dangerous to others. If South Dakota does not take action, the federal government might require the state to submit the names of mentally ill people who have not been found to be dangerous, said Hosmer, who helped write the bill.