— In the wee hours last Friday morning, lawmakers approved a surprise measure as they were leaving town to give House Speaker Thom Tillis and Senate President Pro Tem Phil Berger the same authority as the attorney general to speak for the state in court.

"The Speaker of the House of Representatives and the President Pro Tempore of the Senate, as agents of the State, shall jointly have standing to intervene on behalf of the General Assembly as a party in any judicial proceeding challenging a North Carolina statute or provision of the North Carolina Constitution," reads the provision that was tacked onto an unrelated bill.

Critics of the move say it violates separation of powers between the different branches of government.

"Standing is something that's traditionally decided and granted by the courts. So, it really is unprecedented for lawmakers to simply give themselves standing," said Chris Brook, legal director for the ACLU in North Carolina, which is suing the state over its same-sex marriage ban.

Rep Paul Stam, R-Wake, said he pushed the measure through because Attorney General Roy Cooper, a Democrat, doesn't see eye-to-eye with Republican lawmakers. Cooper has publicly criticized North Carolina's ban on gay marriage, as well as regulations on voting and abortion that were passed this session.

"I just wonder if he's able to set his political opinions aside and look at the words on the page," Stam said Tuesday.

Earlier this month, attorneys general in Pennsylvania and New Mexico said they would not defend their states' same-sex marriage bans.

"If your lawyer won't defend you, for example, on voter rights, you need to be able to defend yourself," Stam said.

Cooper said North Carolina law doesn't allow him to choose not to defend a law, even if he doesn't agree with it.

"It's the job of the attorney general to defend the state, particularly when the state's laws are constitutionally challenged," he said.

The legislation is unnecessary and could make litigation more expensive, Cooper said, adding that it's still up to the judge in any particular case to decide who can speak for the state.

"It provides some opportunity for there to be some inconsistency and confusion in the representation of the state," he said.

Gov. Pat McCrory hasn't said whether he'll sign the bill. Only two other states have similar laws: Wyoming and Oklahoma.