Image copyright Reuters Image caption An AR-15 style assault rifle was used during a shooting in Sandy Hook

A Connecticut court has ruled that families of schoolchildren killed in the 2012 Sandy Hook mass shooting can sue American gun-maker Remington.

In a 5-4 vote, the US state's Supreme Court said the lawsuit could proceed on the basis of state consumer protection laws.

The gun was used by Adam Lanza, who killed 27 people, including 20 elementary school students.

The ruling is a rare legal defeat for an arms firm in a mass shooting case.

The lawsuit, by relatives of nine victims and one survivor, points to the "militaristic" marketing of Remington's AR-15 rifle.

"The families' goal has always been to shed light on Remington's calculated and profit-driven strategy to expand the AR-15 market and court high-risk users, all at the expense of Americans' safety," said Josh Koshoff, a lawyer for the victims' families.

"Today's decision is a critical step toward achieving that goal."

Remington did not immediately respond to a request by the BBC for comment.

Proceedings were initially delayed after the firm filed for bankruptcy last year in the wake of slumping sales.

An initial suit against Remington was thrown out in 2016 and an appeal by the families was taken to the state's highest court last year. It is expected to go to the US Supreme Court.

Under US law, gun makers and dealers are shielded by legislation from legal liability if any of their weapons are used in criminal activity. Exceptions are made, however, in the case of harmful marketing.

Image copyright Getty Images Image caption A wave of school shootings in recent years has brought debate around America's gun laws sharply into focus.

"It seemed kind of unbelievable that this industry would enjoy that kind of protection," said David Wheeler, a father of a Sandy Hook victim, in an interview with the Financial Times.

"It's hard not to look at this [ruling] and think the states are perhaps swinging to a more sensible place."

A wave of school shootings in recent years has brought debate around America's gun laws sharply into focus.

In response, some US retailers have raised the age limit for certain firearms purchases to 21 or stopped stocking semi-automatic weapons.

Last month, the country's House of Representatives approved a bill expanding background checks for all gun sales.

Critics of the legislation say the changes would not have stopped many of recent shootings, and President Trump has pledged to veto the bill if it passes the US Senate.

Lanza killed 20 students and six staff at the school. He had earlier shot his mother dead. As police closed in on the school, he killed himself.