BRIDGEPORT, Conn. - In a packed courtroom here that included relatives of those killed by a gunman at Sandy Hook Elementary School, the makers and sellers of the assault rifle used in the attack made a last-ditch effort on Monday to have a case holding them accountable in the massacre thrown out before trial.
At issue is a 2005 federal law, which shields gun companies from lawsuits when guns are used in a crime. This case - brought by 10 families in the 2012 shooting - has already made it further than many experts had predicted and represents one of the most serious legal threats to the industry in years.
It is playing out in Superior Court in Bridgeport against the backdrop of a renewed debate about gun laws following the mass shooting in Orlando, Fla., this month, an attack that killed 49 people and wounded dozens more.
Following the school massacre, Connecticut lawmakers passed a measure banning the sale of many semiautomatic rifles. On Monday, the Supreme Court declined to hear a Second Amendment challenge to the statute.
To overcome the broad federal immunity granted by Congress, lawyers for the plaintiffs are arguing that both the manufacturers and distributors of assault rifles modeled on the AR-15, like the Bushmaster that was used at Sandy Hook Elementary School, have been negligent.
Such guns are weapons of war, they argue, and they should never have been marketed and sold to civilians.
Near the body of a teacher, Victoria Soto, the police found a weapon "designed to be used in combat to assault and kill enemies of war, in the fields of Vietnam and in the streets of Falluja," said Joshua D. Koskoff, a lawyer for the family members.
"And there it was lying not on a battlefield but on the floor of Vicki Soto's first-grade classroom," he continued. "How did it get there?"
The AR-15, which dates to the 1950s, is one of the most popular weapons in history, with dozens of gun makers issuing their own models and millions having been sold in this country.
James B. Vogts, a lawyer for Remington Arms Company, the maker of the gun used in Newtown, argued that that case was not "the place to debate gun laws."
Mr. Vogts pointed out that the weapons used by Adam Lanza, 20, in the attack on the school were both legally bought by his mother, Nancy Lanza.
He and the lawyers for the other defendants said that the plaintiffs had not met the burden of showing their clients had been negligent and that as a result the case should not be allowed to proceed. They said the question of whether civilians should be allowed to buy and own assault weapons ought to be decided by lawmakers, not the courts.
Judge Barbara N. Bellis of Superior Court asked the lawyers to clarify their argument, wondering why the same rules applied to cigarette manufacturers should not apply to gun makers.
"Cigarettes are legal, but society has changed regarding how safe they may or may not be," Judge Bellis said. "Why does that same concept not apply to AR-15?"
Mr. Vogts said that while societal norms might change, at the time the weapon was sold to Ms. Lanza, "there was a considered judgment" that such weapons could be lawfully owned in Connecticut. If the case is allowed to proceed, he said, "we're going to have piecemeal regulation in this country by juries."
"There is a serious separation of powers issue at play here," he added, "and it needs to be recognized."
That question is at the heart of the case. The judge has until October to decide whether to allow it to go to trial.
The lawsuit was filed in December 2014, and in May, Judge Bellis surprised many by allowing the plaintiffs to move forward with the discovery process.
They want Remington and the other defendants to turn over an assortment of documents related to how they promote the weapon, including the use of video games and internet advertising.
If the case is allowed to proceed, the lawyers for the gun companies said they would ask that any evidence found during discovery be sealed from public disclosure.
From the outset, the case has been freighted with emotion, and the hearing on Monday was no exception.
Before the hearing, Mathew Soto, the brother of Ms. Soto, the teacher, said he was overcome with "sadness, grief, disgust" after the Orlando shooting. "No one should ever be put in that position again," Mr. Soto said.
"Yet so many families have to go through that process in this country," he added. "Because our country cannot come together on the issue of assault rifles, mass shootings will continue."