— The North Carolina Senate voted Monday night to override Gov. Pat McCrory's veto of legislation that would allow magistrates to opt out of performing wedding ceremonies.

After the 32-16 Senate vote, the bill is now in the hands of the state House, where the margin is expected to be tighter. Three-fifths of those present in each chamber are required to vote yes for a bill in order to pass a measure over the governor's objections.

House members are scheduled to vote on the override Wednesday.

Although a magistrate would have to recuse himself or herself from performing any marriages for at least six months, the bill is widely read as a way to give those who object to performing same-sex weddings legal cover. The measure came in the wake of a federal court ruling saying North Carolina's laws blocking gay marriages were in violation of the Constitution.

McCrory has said that, like many lawmakers, he does not favor allowing gay and lesbian couples to marry. However, he said in a veto statement that judicial officials must uphold the laws of the state.

"We are a nation and state of laws," McCrory wrote. "Whether it is the president, governor, mayor, a law enforcement officer or magistrate, no public official who voluntarily swears to support and defend the Constitution and discharge the duties of their office should be exempt from upholding that oath."

Senate President Pro Tem Phil Berger said he took exception to the governor's characterization of the bill. Rather, he said, Senate Bill 2 merely gives otherwise dedicated public servants a way to continue working for the state without compromising their religious principles.

"They do not park their first amendment rights at the door," Berger, R-Rockingham, said.

But Sen. Floyd McKissick, D-Durham, said that magistrates and employees in county register of deeds offices who issue marriage licenses take an oath to uphold the laws of the state.

"The law of North Carolina today recognizes same-sex marriages," McKissick said.

He said the bill could allow magistrates to opt out based on their preference not to marry couples of different races.

Other senators said the bill sends the wrong messages to prospective companies looking to come to North Carolina.

The bill is the subject of intense scrutiny by outside groups.

"Every American is guaranteed the freedom to live and work consistent with their faith without unnecessary government interference," said Concerned Women for America state director Sheri Miller. "The government shouldn't have a license to punish Americans for exercising these basic civil rights."

Pro-LGBT groups decried the Senate vote.

"From the business community to local leaders across the state to the Governor, North Carolinians have stood up and said Senate Bill 2 is deeply problematic legislation," said Chris Sgro, executive director of Equality North Carolina. "SB 2 aims to discriminate against same-sex couples and, in the process, creates problems for all people who seek use of taxpayer-funded public services."