The state Senate on Wednesday approved wide-ranging legislation in response to last year’s deadly school shooting in Newtown, including gun control measures that ban the sales of large-capacity ammunition magazines and more than 100 weapons that previously had been legal.

After a respectful and at times somber debate, the Senate voted 26-10 in favor of a bill crafted by leaders from both major parties in the Democratic-controlled legislature. The vote was bipartisan, with two Democrats voting with Republicans against the bill and six Republicans joining the Democrats in supporting it.

The bill was to go to the House of Representatives, which was expected to pass it. It would then be sent to Democratic Gov. Dannel P. Malloy, who has said he’ll sign it into law.

The December massacre of 26 people inside Sandy Hook Elementary School, which reignited a national debate on gun control, set the stage for changes in Connecticut that may have been impossible elsewhere: The governor, who personally informed parents that their children had been killed that day, championed the cause, and legislative leaders, keenly aware of the attention on the state, struck a bipartisan agreement they want to serve as a national model.

“The tragedy in Newtown demands a powerful response, demands a response that transcends politics,” said Senate President Donald E. Williams Jr., a Democrat. “It is the strongest and most comprehensive bill in the country.”

Republican Senate Minority Leader John McKinney, of Fairfield, whose district includes Newtown and who is a key author of the legislation, spoke about how he has felt blessed to represent the bucolic New England town for 14 years and how he proudly wears a green ribbon and angel pin each day in honor of those killed.

“I try to put it on my jacket every day to remember those that we’ve lost because I stand here — I stand here as their voice, as their elected representative,” said McKinney.

The legislation adds more than 100 firearms to the state’s assault weapons ban and creates what officials have called the nation’s first dangerous weapon offender registry as well as eligibility rules for buying ammunition. Some parts of the bill will take effect immediately after Malloy’s signature, including background checks for all firearms sales.

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

Many senators on Wednesday spoke about balancing the rights of gun owners with addressing the horror of the Sandy Hook shooting. Lawmakers said they received thousands of emails and phone calls urging them to vote for or against the bill, with veteran Sen. Joan Hartley, a Democrat, saying she’s never seen a more polarizing issue at the state Capitol.

Gun rights advocates who greatly outnumbered gun control supporters in demonstrations early in the day at the Capitol railed against the proposals as misguided and unconstitutional, occasionally chanting “No! No! No!” and “Read the bill!”

“We want them to write laws that are sensible,” said Ron Pariseau, of Pomfret, who was angry he’ll be made a felon if he doesn’t register his weapons that will no longer be sold in Connecticut. “What they’re proposing will not stop anything.”

By the time the Senate voted after six hours of debate, many of the gun rights advocates had gone home, leaving behind proponents of the bill who applauded when the tally was read.