A bill that will allow Quebec to create its own gun registry has earned the overwhelming support of the National Assembly.

MNAs voted 99 to eight in favour of replacing the long-gun registry that was dismantled by the federal government in 2012.

The new law will require all firearms in the province to have a serial number, which will then be inscribed in a database. Gun sales will also have to be signaled to authorities.

Of the votes against the registry, seven came from members of the Coalition Avenir Québec, though 10 Liberal MNAs were noticeable by their absence.

The bill faced stiff opposition from Quebec's gun lobby, which had organized several protests outside the offices of rural MNAs.

'I was so happy'

The bill was initially tabled in December, and its supporters celebrated it being passed on the second-to-last day of the legislative session.

"I screamed. I was ecstatic. I was so happy," Louise de Sousa said Thursday after hearing the news.

Her daughter Anastasia was killed in the Dawson College shooting almost 10 years ago.

"For me, what it means, is some kind of security," de Sousa said. "It won't stop every single shooting there might be. But if it stops one ... that makes a difference."

The registry is expected to be up and running by 2018. Its creation will cost an estimated $17 million. Annual operating costs are pegged at $5 million.