(Reuters) - Florida’s legislature on Wednesday passed a bill allowing teachers to carry guns in the classroom, expanding a program launched after the deadly high school shooting in Parkland with the aim of preventing another such massacre.

Florida’s House of Representatives voted 65 to 47 to pass the bill after hours of debate over two days in which the Republican majority thwarted Democratic efforts to amend, stall or kill the measure. Florida’s Senate approved it 22 to 17 last week.

Republican Governor Ron DeSantis is expected to sign the bill into law, enabling school districts wishing to take part in the voluntary Guardian program to arm those teachers who pass a 144-hour training course.

On Feb. 14, 2018, a former student armed with a semiautomatic rifle opened fire at Marjory Stoneman Douglas High School in Parkland, Florida, killing 17 people and wounding 17 others.

President Donald Trump and the National Rifle Association have argued an armed teacher could provide the best defense against a shooter bent on mass murder.

Opponents questioned whether the solution to gun violence should be the presence of even more guns and warned of the danger of a teacher misfiring during a crisis or police mistaking an armed teacher for the assailant.

Passage marks a victory for gun-rights advocates, who were on the defensive a year ago when Parkland students inspired nationwide protests in favor of gun control.

After the Parkland shooting, Florida lawmakers rushed through legislation that required schools to place at least one armed staff member or law-enforcement officer at each campus.

The law also imposed a three-day waiting period for gun purchases and raised the age limit for buying rifles from 18 to 21 - remarkable measures in a gun-friendly state.

Although last year’s law allowed some school personnel to carry weapons, guns were still banned from the classroom.

Backers of arming classroom teachers revived the issue this year, arguing that school shootings often erupt too quickly for law enforcement to respond.

In anticipation of passage, school employees in 40 of Florida’s 67 counties already enrolled in or planned to take the 144-hour course, a spokesman for the Speaker of the House said. Some counties have resolved not to participate in the Guardian program.

Florida’s gun-control advocates had made stopping the proposal a top priority, among them Moms Demand Action For Gun Sense, which is funded by billionaire and former New York City Mayor Michael Bloomberg.