RALEIGH, N.C. (AP) — North Carolina Gov. Roy Cooper vetoed gun-rights legislation on Friday that would allow parishioners at more churches to be armed, marking the second year in a row that he's blocked the idea.

The legislation affirms that people going to religious services at a location where private schools or some charter schools also meet can carry handguns in full view or under clothing if they have a concealed weapons permit. There would be other limits.

The Democratic governor said the measure, which cleared the legislature last week, would endanger educators and children. State law otherwise prohibits guns on educational property for nearly everyone.

“For the safety of students and teachers, North Carolina should keep guns off school grounds,” Cooper wrote in his veto message.

The bill's supporters contend these houses of worship where K-12 schools also are located are at a security disadvantage for their congregants compared to stand-alone churches. There are no such blanket prohibitions in these churches on carrying a pistol, provided the person has a purchase permit or concealed weapons permit.

The bill also contains another provision that allows additional law enforcement employees — such as a civilian front desk worker at a police station — to carry a concealed weapon on the job if the police chief or sheriff allows it and the person has a concealed permit.

Both items were contained in a broader 2020 gun bill that Cooper also vetoed. Like last year, several House and Senate Democrats joined Republicans in initially voting for the measure before the veto. During the GOP attempt to override the 2020 veto, Cooper managed to collect additional House Democratic votes to uphold his veto. He'll have to do the same thing this year to stop the measure.

Ministers of several churches with affiliated schools spoke in committee this year to request the option to be armed in light of high-profile reports of shooters targeting congregations.

Paul Valone with the gun-rights group Grass Roots North Carolina said “there is no rational reason” for the veto, especially since concealed weapons holders have been able to carry in many churches for 25 years due to state law. He urged lawmakers to override it.

"I didn’t think after the violent attacks in churches across the nation that it would be controversial to allow our citizens to protect themselves in church on Sundays, but the governor’s blind opposition to the Second Amendment seems to outweigh common-sense legislation,” said the bill's chief's sponsor, GOP Sen. Danny Britt of Robeson County.

In response to concerns about student safety, the measure contains language stating permit holders can only carry a gun on the church campus outside operating and extracurricular hours at the school. Like standalone places of worship, the churches also could opt out and prohibit weapons by posting a sign.

Democratic opponents of the measure said these churches should hire private security, instead of encouraging shootouts. If the bill became law, people are unlikely to understand the distinction that guns must be left at home when school activities are happening, according to the North Carolinians Against Gun Violence Action Fund.

“We thank Gov. Cooper for vetoing this dangerous bill that circumvents state policy outlawing concealed carry of firearms on school grounds and would put school children at more risk of gun violence,” Action Fund executive director Becky Ceartas said in a news release.

Cooper's action is just his second veto this year. He vetoed 25 bills during the previous two-year legislative session, none of which were overridden.