North Carolina lawmakers on Thursday overrode Republican Governor Pat McCrory's veto of a bill that will allow some court officials to opt out of duties related to marrying gay and lesbian couples.

The bill, SB2, allows magistrates and some register of deeds workers to avoid duties for all marriages based on a “sincerely held religious objection.”

The Republican-led House joined the Senate in overriding McCrory's veto early Thursday morning with a 69-41 vote.

Rev. Jasmine Beach-Ferrara, executive director of the Campaign for Southern Equality (CSE), called the bill discriminatory and unconstitutional in a statement.

“Senate Bill 2 is unconstitutional, and will undoubtedly be challenged in court. This bill, which will now become law, is discriminatory and treats gay and lesbian couples as second class citizens. We are more determined than ever to achieve full equality for LGBT people in North Carolina and to ensure that LGBT youth know that they are not alone.”

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 measure's chief sponsor, Senate leader Phil Berger, a Republican, vowed to introduce the legislation shortly 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.

The American Civil Liberties Union (ACLU) of North Carolina also criticized passage of the bill.

“This is a sad day for North Carolina that history will not judge kindly,” Sarah Preston, acting executive director of the ACLU of North Carolina, said in a statement. “Just eight months after our state extended the freedom to marry to same-sex couples, extremist lawmakers have passed discrimination into law, allowing government officials to deny marriage services to virtually any couple. This shameful backlash against equality will make it harder for all couples in our state to marry and force many to spend what is supposed to be a happy day trapped in a maze of government offices. We encourage any North Carolina couples who encounter new hurdles because of this discriminatory law to contact our office.”