RICHMOND, Va. — After a county clerk in Kentucky spent five days in jail last year for refusing to issue marriage licenses to same-sex couples, a Republican lawmaker in Virginia is pushing legislation aimed at protecting local elected officials who object to certain marriages on moral or religious grounds.

Republican Sen. Charles Carrico of Galax, whose southwestern district borders Kentucky, said many of his constituents were concerned about what happened to Kim Davis, the Rowan County clerk, and asked him to help Virginia officials who are put in the same position.

“I’m just trying to clarify what the options are if they have a right-of-conscience issue,” said Carrico, who said he opposes gay marriage.

Democratic Gov. Terry McAuliffe has already vowed to veto the bill if it passes the GOP-controlled General Assembly.

“Gov. McAuliffe believes legislation like this would send the wrong message to people around the globe about the climate Virginia offers businesses and families who may want to locate here,” Irma Palmer, a McAuliffe spokeswoman, said in a written statement. Republicans would need significant Democratic support to override a veto, which is unlikely.

Davis stopped issuing all marriage licenses the day after the U.S. Supreme Court effectively legalized gay marriage nationwide, saying it would be a sin for her to license a same-sex couple. A federal judge jailed her and ordered her deputy clerks to issue the licenses.

Newly elected Kentucky GOP Gov. Matt Bevin, who supported Davis’ actions, issued an executive order last month removing the names of clerks from marriage licenses in the state in an attempt to protect the religious beliefs of local elected officials. State Senate Republican leaders are pushing legislation that would put Bevin’s order into law.

Carrico’s bill specifies that clerks and deputy clerks wouldn’t have to issue licenses if they object on “personal, ethical, moral or religious grounds.” It would establish a process to ensure that people whose licenses are denied would be able to get one from the Department of Motor Vehicles, Carrico said.