HARTFORD, Conn. — Gov. Dannel P. Malloy, who four months ago broke the news to shocked parents that their children had been slaughtered in a Connecticut elementary school, signed into law Thursday sweeping new restrictions on weapons and large capacity ammunition magazines similar to the ones used by the gunman.

Malloy signed the bill at a state Capitol ceremony at noon, only hours after the General Assembly approved the measure early Thursday morning to give the state some of the toughest gun laws in the country.