Surrounded by pro-gun rights protesters heckling him outside the Vermont State House Wednesday, Republican Gov. Phil Scott signed into law the most restrictive gun control measures in the state’s history.

While some had come to thank him, Scott knew that many there who voted for him based in part on his A-grade rating from the NRA were “disappointed and angry” with him, he said.

Some yelled “Traitor!” and “BS!” as he tried to assure them that the laws he was about to sign were not intended to “take away your guns – period.” Others told him he had lost their votes and brandished signs that said “One Term Gov” and “Not My Governor.”

But it was clear from his remarks that Scott had already considered all of that. Two months ago, after police foiled an alleged school shooter’s plans to storm a local high school and kill as many as possible, Scott said he could no longer sit back and do nothing. He had already made up his mind then.

“I know these discussions have been difficult, emotional and complex – barriers that frequently lead to inaction,” he told the divided crowd. “But this is not the time to do what’s easy. It’s the time to do what’s right.”

The three laws Scott signed Wednesday ban the possession and sale of bump stocks and magazines holding more than 10 rounds for a long gun and 15 for a handgun, unless purchased prior to Oct. 1.

To ensure background checks on private gun sales, the new laws require that all guns be bought and sold through a licensed firearm dealer, excluding sales between immediate family members. Buyers must be at least 21, unless they complete a Vermont hunter safety course or are in the military or law enforcement. The laws also allow police to confiscate a gun from somebody under specific circumstances when the person poses a threat.

Under House bill 422, law enforcement can temporarily confiscate a gun from somebody who has just been arrested for domestic violence, in which case a judge would decide whether to return the gun to the defendant at the next-business-day arraignment hearing.

The judge could decide that not possessing a gun should be a condition of the defendant’s release, or that the gun should be taken from the defendant under other abuse-prevention orders. Under Senate bill 221, the state can seek an “extreme protection order” that “prohibits a person from possessing a firearm for up to one year” if a court finds that the person “poses a significant danger of causing injury to himself or another person.”

Violation of these laws could result in jail time between six months and a year or fines between $500 and $1,000.

The passage of the gun-control laws in Vermont marks a significant change in course in a state where bipartisan resistance to gun-control measures thwarted even the most modest gun-restriction proposals for years. Vermont still does not require law-abiding gun owners to have a permit to carry guns in public. During his 2016 campaign for governor, Scott himself said, “I don’t believe we need more gun restrictions in Vermont at this time. And that he did not support background checks on private gun sales.

His about-face on gun rights all happened rather quickly, in the days after the Parkland school shooting that left 17 dead.

Two days after the shooting, police in Fair Haven, Vermont, arrested Jack H. Sawyer for alleged plot to shoot up Fair Haven Union High School. That morning, Scott said, is when “everything changed” for him.

After police were notified of a threatening Facebook message Sawyer allegedly sent about his alleged plot, they brought him into the station for an interview. According to Vermont Supreme Court documents, Sawyer told police that he wanted to “exceed the body count from the Virginia Tech shooting” – which left 33 dead including the shooter – “and that he had chosen his ammunition accordingly.” He wanted to end the shooting in the school library, “in mimicry of the Columbine shooting,” the court document said.

When police searched his car, they found a shotgun, 17 rounds of ammunition and four books about school shootings, including the Columbine massacre. They found a journal titled, “The Journal of an Active Shooter,” in which Sawyer allegedly wrote about his desire to “commit suicide by homicide.”

He has pleaded not guilty to the attempted murder charges against him.

“The day will be coming much more sooner than previously thought,” he wrote on Nov. 29, according to the documents. “I’ve realized the huge importance of being able to kill the kids that I actually now know vs. waiting a year or so until they’re all gone. I’m aiming to kill as many as I can and whoever I can.”

An affidavit describing the allegations against Sawyer landed on Scott’s desk.

“As I processed this information, I was shocked,” he said at the press conference. “Just 24 hours before – even in the aftermath of Parkland – I thought, as the safest state in the nation, Vermont was immune to this type of violence. . . . Sitting there, I realized, only by the grace of God did we avert a horrific outcome.”

The realization caused him to “do some soul searching.” He had been a gun owner his entire life, he said. He was a hunter and a fisherman, and at home he had a safe full of guns, including the one he got when he was 13. While he was a state senator and lieutenant governor he never felt the need to change the gun laws. He thought the state was somehow “different” from the others, “somewhat insulated from the violence the rest of the world was seeing.”

“But I was wrong. And that’s not always easy to admit,” he said. “I support the Second Amendment, but I had to ask myself, ‘Are we truly doing everything we can to make our kids and communities safer?’ Because if we’re at a point where our kids are afraid to go to school, and parents are afraid to put them on a bus, or police don’t have the tools they need to protect victims of violence, or families can’t step in to prevent a loved one from taking their own life – then who are we?”

Vermont is the second state after Florida to pass a gun-reform package in the wake of the Parkland shooting. New Jersey is poised to become the third, with one of its proposed measures requiring people applying for gun permits to show a “justifiable need.”

Scott stressed that the reforms are not just about guns: As part of an action plan he drew up in February, he also committed to creating a Violence Prevention Task Force through executive order, worked with the legislature to allocate $5 million in school security grants and asked the state legislature to “upgrade our mental health system.”

“I recognize how hard it is for some to understand my change of heart on our gun laws, let alone come to the same conclusions I’ve reached,” he told the divided crowd in closing. “I understand I may lose support over the decision to sign these bills today. Those are consequences I’m prepared to live with.”