“And these are the religious people?!”

The state Capitol turned into a chaotic scene Thursday as both houses of legislature — and eventually Gov. Cuomo — passed a bill that will end New York’s policy of allowing religious exemptions from vaccine requirements.

Assemblyman Jeffrey Dinowitz, the bill’s sponsor, got cursed out and flat-out threatened at one point by opponents of the legislation after it got passed and sent to the Senate floor.

“We’ll be back for you Jeffrey!” shouted one man in Orthodox religious garb, who was fuming in the gallery with others, many of whom had children with them.

“Motherf–ker!” screamed another person. “Shame!”

Dinowitz and other lawmakers remained calm during the mayhem, but were on edge as they recessed for the day.

“I’m sure the hallways are very dangerous for me right now,” Dinowitz said afterward. “I think it’s very sad that people who are up here in the name of religion were acting anything but. Judging by the way some people behaved and judging by the threats that we heard from some people, it would be prudent to exercise some caution.”

Gov. Cuomo wound up signing the bill into law just hours later.

“The science is crystal clear: Vaccines are safe, effective and the best way to keep our children safe,” the governor said in a statement. “This administration has taken aggressive action to contain the measles outbreak, but given its scale, additional steps are needed to end this public health crisis.”

The vaccine problem was witnessed first-hand Thursday at two schools in Williamsburg, which had to be closed by the Health Department for allowing dozens of unvaccinated students to attend classes, according to officials.

Cuomo said that while he understands and respects the right to freedom of religion, “our first job is to protect the public health and by signing this measure into law, we will help prevent further transmissions and stop this outbreak right in its tracks.”

Dinowitz’s bill had been approved by the Democrat-led Assembly by a 77-53 vote, though the tally was unofficial. The legislation will end non-medical exemptions for vaccines statewide.

“This bill was never about [religion], it was about public health, as I said on the floor,” Dinowitz explained. “It’s going to protect children’s health and we’ll never know which children don’t catch a terrible disease, but we know for this bill it will protect children.”

The lawmaker said he was disappointed by the behavior seen today in the Assembly chamber but was hopeful that the anti-vaxxers would “calm down” and “be a little more civilized.”

“I don’t ever remember in all my years here, the screaming in the Assembly chamber and the disruption in the Assembly chamber — people yell and scream outside and that’s fine, that’s fine — but the disrespect, not to me … Forget me … to the institution, to all the members of the state … was frankly a disgrace,” Dinowitz said. “And these are the religious people?! Shame on them. Shame on them.”