MONTREAL -- A judge has rejected an attempt to put a stop to Quebec's provincial long-gun registry.

The National Firearms Association and a Quebec-based pro-gun lobby group had argued in court the province infringed on federal jurisdiction when it passed its long-gun registry law in June 2016.

To prevent Quebec from going ahead, the gun lobby had demanded an injunction and full arguments not long after the law was passed.

But Quebec Superior Court Justice Lukasz Granosik ruled this week the registry is constitutionally valid and that Quebec has a right to move forward with it.

Granosik said the Quebec law is essentially about public safety -- which is related to provincial jurisdiction on issues of property and civil law as well as the administration of justice.

The province began plans to establish its own long gun log after the Conservatives abolished the federal database for non-restricted guns, known as the long-gun registry, in 2012.