The Virginia Senate has passed legislation aimed at allowing guns in church in response to a deadly church shooting in Texas.

The Republican-controlled chamber voted along party lines Tuesday to approve the measure, which would repeal a state law prohibiting weapons in a place of worship during a religious service. The state House still has to approve the bill, which Democratic Gov. Ralph Northam opposes and has indicated he would veto.

Supporters say Virginia's prohibition on carrying a "gun, pistol, bowie knife, dagger," or other dangerous weapons into churches during worship service is an archaic remnant of the state's "blue laws" enacted in the 1800s to prohibit certain activities on Sundays.

A state Attorney General's opinion from 2011 says current law already allows Virginians to carry guns in churches, subject to a church's permission. But GOP Sen. Ben Chafin, the bill's sponsor, said the legislature needed to clarify and cement the right to carry a gun in church into law if a church allows it.

"It's a private property rights issue," said Chafin.

Much of the debate on the bill focused on last year's church shooting in Texas, when a gunman opened fire during a Sunday service at First Baptist Church in Sutherland Springs and killed more than two dozen worshippers.

"In the communities that I represent, there are a whole lot of first Baptist churches," Chafin said.

Democratic Sen. Jeremy McPike said the Republican bill was too broad and there were better ways of letting houses of worship decide their own weapons policies.

"Those who are voting for this measure are voting for guns over God," McPike said.

His legislation requiring that individuals carrying guns in churches have "express authorization" from the church to do so was blocked earlier this year by a GOP-controlled committee.