The North Carolina Senate on Wednesday approved a bill which seeks to allow magistrates to opt out from marrying gay and lesbian couples.

Gay couples began marrying in North Carolina in October after the state's ban on gay marriage was struck down by a federal court.

The bill allows magistrates to opt-out from performing marriages by citing a “sincerely held religious objection.”

The measure's chief sponsor, Senate leader Phil Berger, a Republican, vowed to introduce the legislation after a magistrate in his district decided to resign after 12 years rather than marry gay couples.

Berger organized a rally for John Kallam Jr. outside the Rockingham County Courthouse.

“[F]orcing Magistrate Kallam to give up his religious liberties to save his job is just wrong,” Berger said at the time.

Wednesday's 32-16 vote was largely along party lines, with Republicans mostly in favor of the legislation.

At least six other states are considering similar measures.