As state officials across the country grapple with how to prevent mass killings like the ones at Sandy Hook Elementary School in Newtown, some are turning to a gun-seizure law pioneered in Connecticut 15 years ago.

Connecticut’s law allows judges to order guns temporarily seized after police present evidence that people are a danger to themselves or others. A court hearing must be held within 14 days to determine whether to return the guns or authorize the state to hold them for up to a year.

The 1999 law, the first of its kind in the country, was in response to the 1998 killings of four managers at the Connecticut Lottery headquarters by a disgruntled employee with a history of psychiatric problems.

Indiana is the only other state that has such a law, passed in 2005 after an Indianapolis police officer was shot to death by a mentally ill man. California and New Jersey lawmakers are now considering similar statutes, both proposed in the wake of the killings of six people and the wounding of 13 in May near the University of California at Santa Barbara by a mentally ill man who had posted threatening videos on YouTube.

Michael Lawlor, Connecticut’s undersecretary for criminal justice planning and policy, believes the state’s gun-seizure law could have prevented the killings of 20 first-graders and six educators at Sandy Hook Elementary in December 2012, if police had been made aware that gunman Adam Lanza had mental-health problems and access to his mother’s legally owned guns.

“That’s the kind of situation where you see the red flags and the warning signs are there, you do something about it,” Lawlor said. “In many shootings around the country, after the fact it’s clear that the warning signs were there.”

Gun rights advocates oppose gun-seizure laws, saying they allow police to take people’s firearms based only on allegations and before the gun owners can present their side of the story to a judge. They say they are concerned the laws violate constitutional rights.

“The government taking things away from people is never a good thing,” said Rich Burgess, president of the gun rights group Connecticut Carry. “They come take your stuff and give you 14 days for a hearing. Would anybody else be okay if they just came and took your car and gave you 14 days for a hearing?”

Rachel Baird, a Connecticut lawyer who has represented many gun owners, said one of the biggest problems with the state’s law is that police are abusing it. She said she has had eight clients whose guns were seized by police before the required warrants were obtained.

“It’s stretched and abused, and since it’s firearms, the courts go along with it,” Baird said of the law.

But backers of such laws say they can prevent shootings by getting guns out of the hands of mentally disturbed people.

“You want to make sure that when people are in crisis . . . there is a way to prevent them” from getting access to firearms, said Josh Horwitz, executive director of the Educational Fund to Stop Gun Violence, a Washington-based nonprofit group.

Connecticut authorities report a large increase in the use of gun-seizure warrants involving people deemed dangerous by police over the past several years. Officials are not exactly sure what prompted the increase but believe it is related to numerous highly publicized mass shootings in recent years.

Police statewide filed an estimated 183 executed gun-seizure warrants with court clerks last year, more than twice the number filed in 2010, according to Connecticut Judicial Branch data. Last year’s total also was nearly nine times the annual average in the first five years of the gun-seizure law.

Connecticut police have seized more than 2,000 guns using the warrants, according to the most recent estimate by state officials, in 2009.

Police in South Windsor, about 12 miles northeast of Hartford, say the law was invaluable last year when they seized several guns from the home of a man accused of spray-painting graffiti referencing mass shootings in Newtown and Colorado on the outside of the town’s high school.

“With all that we see in the news day after day, particular after Newtown, I think departments are more aware of what authority they have . . . and they’re using the tool more frequently than in the past,” said South Windsor Police Chief Matthew Reed. “We always look at it from the other side. What if we don’t seize the guns?”