Hours after state lawmakers approved such legislation, North Carolina's governor on Thursday vetoed a bill that would have allowed some court officials to refuse to perform same-sex marriages, the Associated Press reported.

Republican Pat McCrory said he believed that public officials who swear to support and defend the Constitution and carry out their duties should not be exempt from upholding that oath.

"I recognize that for many North Carolinians, including myself, opinions on same-sex marriage come from sincerely held religious beliefs that marriage is between a man and a woman," he said, according to Reuters. "However, we are a nation and a state of laws."

The bill approved by the legislature would have given magistrates and some register-of-deeds workers the option to avoid duties for marriages to which they had a "sincerely held religious objection." By asking to be recused in writing, they would have been barred from performing any union, gay or straight, for six months, the newswire explained.

The bill now returns to the legislature, where at least three-fifths of the lawmakers in each chamber would have to support it to override the governor's veto, ABC affiliate WTVD noted. In their original tallies, both the House and Senate had passed the legislation above that threshold.

Supporters of the effort said it would offer needed protection for magistrates who refuse to perform same-sex marriages, which became legal in North Carolina last year after a U.S. District Court judge ruled that the state's ban on such unions was unconstitutional.

"Really the question is: Should you be fired from a job or subject to disciplinary action because you choose to live your life by sincerely held religious beliefs?" Republican Rep. Dean Arp told Reuters.

But opponents, such as Democratic Rep. Grier Martin, compared the legislation to the "separate but equal" principle once used to segregate students by race, the newswire noted.

"This sets up a separate system of marriage," Martin argued. "We've tried 'separate but equal' before in this state; it did not work then, and it does not work now," the lawmaker insisted.