RICHMOND, Va. -- 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. 

RELATED: NC armed pastor stops church break-in

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.

Last year, a gunman opened fire during a Sunday service at a Baptist church in Texas, killing more than two dozen worshippers.

Get the latest news, sports and weather delivered straight to your inbox. Click here to sign up for email and text alerts.