— Republican lawmakers can intervene in a pair of challenges to North Carolina's now-defunct gay marriage ban, potentially enabling them to appeal the issue to the U.S. Supreme Court, a federal judge ruled Tuesday.

Chief U.S. District Court Judge William Osteen Jr. issued an order granting requests by House Speaker Thom Tillis and Senate leader Phil Berger seeking to intervene in the cases. Osteen's order follows a separate ruling Friday by U.S. District Court Judge Max O. Cogburn Jr. declaring the ban unconstitutional, triggering a rush of joyful same-sex couples getting legally married.

Osteen agreed with Cogburn that a July ruling by the 4th U.S. Circuit Court of Appeals in Virginia required that North Carolina's ban must be struck down. However, he differed on whether the Republican leaders should be allowed to enter the cases. The state's Democratic attorney general has concluded any further defense of the prohibition would be futile.

Tillis, who is currently campaigning for the U.S. Senate, has been a vocal supporter of the ban approved by state voters in 2012.

"In reaching this conclusion, this court is not expressing an opinion on the relative merits or demerits of any appeal, only that there is an appeal right that a party with arguable standing and interest has sought to preserve," wrote Osteen, who was appointed to the bench by President George W. Bush.

Both sides claimed victory following Osteen's ruling.

“Today’s ruling recognizes that the more than 60 percent of North Carolina voters who define marriage as between one man and one woman deserve their day in court, and this decision is an important step to ensure their voice is heard," Senate President Pro Tem Phil Berger said in a statement.

"Judge Osteen’s ruling is the second in five days to declare North Carolina’s ban on marriage for same-sex couples to be unconstitutional,” Chris Brook, legal director for the ACLU of North Carolina, said in a statement. “The legislature can attempt to pursue an appeal if they so choose; however, that would only unnecessarily expend taxpayer resources. North Carolinians can rest assured: the freedom to marry is here to stay.”