Connecticut, the US state where 20 children were shot dead at school in December, is to bring in the country's strictest gun control laws after legislation was passed by its senate and lower house. The governor, Dannel P Malloy, a Democrat, said he was ready to sign the bill into law on Thursday.

The state, where gun manufacturing dates back to the war of independence, has wrestled with the issue of gun safety since 20-year-old Adam Lanza shot his way into a school in Newtown with a high-powered rifle legally purchased by his mother, whom he also killed.

The massacre reignited national debate on gun control, and Barack Obama has made the issue a defining one for his second term, which started a month after the shooting.

His proposed gun control measures have largely stalled in Congress, however, and Obama is due to visit Connecticut next week in an effort to increase pressure on Capitol Hill.

Obama visited Colorado on Wednesday and repeated his call for universal background checks for gun buyers – a measure that has better chances of winning enough support in Congress than an assault weapons ban or limits on large-capacity ammunition magazines.

Obama's visit was heavy with political symbolism because Colorado recently expanded gun control laws, despite being a western, largely rural state where gun ownership is a cherished right. Colorado has suffered two of the worst mass shootings in US history – at Columbine school in 1999 and at a cinema in Aurora in 2012. It has expanded background checks for gun purchases and placed restrictions on ammunition magazines.

Obama said Colorado's action showed "there doesn't have to be a conflict" between keeping citizens safe and protecting the right to bear firearms guaranteed by the US constitution.

The powerful National Rifle Association, however, maintains that more guns keep people safer and has succeeded in blocking many efforts to impose stricter controls. Several county sheriffs in Colorado have vowed not to enforce the new gun restrictions.

In Connecticut the new legislation would add more than 100 firearms to the state's assault weapons ban and create what officials have called the nation's first dangerous weapon offender registry.

Connecticut would join states including California, New York, New Jersey and Massachusetts in having the country's strongest gun control laws, said Brian Malte, the director of mobilisation for the Brady Campaign to Prevent Gun Violence.

Gun rights advocates and some Connecticut politicians have questioned whether the legislation would have done anything to stop Lanza.

Law-abiding gun owners were paying the price for the actions of a deranged young man, said the Republican state senator, Tony Guglielmo. "I think we need to do something but I guess we should be doing something that does good, not something that just feels good," he said.