The Supreme Court granted an emergency request on Wednesday to halt gay marriage in Virginia just hours before same-sex couples would have been legally allowed to wed.

Chief Justice John Roberts, who has jurisdiction over emergency injunction requests in the region, referred the matter to the full Supreme Court, which granted the stay.

Gay couples would have been allowed to marry starting Thursday under a recent ruling by the 4th Circuit Court of Appeals, which held that Virginia’s gay marriage ban violated the Constitution’s equal protection clause. The decision is being appealed to the Supreme Court.

The Supreme Court’s decision on Wednesday was procedural; it won’t affect a final decision on the merits about whether gay marriage bans are constitutional. The justices are expected to take up the issue, potentially as early as next year.

McGuigg v. Bostic Order