MONTGOMERY, Ala. β€” A federal judge in Mobile ruled Thursday that a southern Alabama probate judge could not deny marriage licenses to same-sex couples based on state law.

The case involved four same-sex couples in Mobile unable to obtain marriage licenses from county Probate Judge Don Davis. Davis closed his Mobile County marriage license office Monday following Alabama Chief Justice Roy Moore’s order to probate judges prohibiting them from issuing licenses to couples of the same gender.

“If plaintiffs take all steps that are required in the normal course of business as a prerequisite to issuing a marriage license to opposite-sex couples, Judge Davis may not deny them a license on the ground that plaintiffs constitute same-sex couples,” U.S. District Judge Ginny Granade wrote.

In January, Granade struck down Alabama’s 1998 law and 2006 constitutional amendment that banned same-sex marriage, saying they violated gay couples’ equal protection and due process rights under the 14th Amendment to the U.S. Constitution. That made Alabama the 37th state where gay couples can legally wed.

Moore had asserted that state courts have an authority equal to lower federal courts in interpreting the Constitution, causing confusion among the state’s probate judges, who are elected officials similar to many states’ county clerks and justices of the peace and often not lawyers. Messages seeking comment Thursday from Moore were not immediately returned.

Granade did not directly address Moore’s order in her eight-page decision but wrote that Davis “and all his officers, agents, servants and employees, and others in active concert or participation with any of them, who would seek to enforce the marriage laws of Alabama which prohibit or fail to recognize same-sex marriage” were bound by her decision.

“It sounds like she gave us what we were looking for, and that’s a clear message that this does in fact apply to probate judges,” said Legal Director Randall Marshall of the ACLU of Alabama, which represented the plaintiffs. “Hopefully, the rest of them will get the message so they, too, don’t find themselves in a courtroom.”

Granade made her ruling shortly before 4 p.m. CT a few hours after a brief hearing on the case. Mobile County’s marriage bureau, which usually has hours until 5 p.m. weekdays, did not re-open immediately.

After the hearing Michael Druhan, Davis’ lawyer, had said he and his client would have to look at any order from Granade before deciding what to do.

“All probate judges should do their duties as public servants and begin to issue licenses to committed, loving same-sex couples immediately.” said Legal Director Sarah Warbelow of the Human Rights Campaign, which advocates for lesbian, gay, bisexual and transgender equality.

As of noon CT, right before the court hearing, 23 counties were issuing marriage licenses to all couples, but 18 refused gay couples, the Human Rights Campaign said. Twenty-six counties, including Mobile County, had closed their marriage-license bureaus; Alabama has 67 counties.

The legal battles may continue. Two groups opposed to same-sex marriage asked the Alabama Supreme Court on Wednesday to stop probate judges from issuing same-sex marriage licenses. Lawyer Eric Johnston, representing the Alabama Policy Institute and the Alabama Citizens Action Program, said before Thursday’s ruling that they would continue with the action regardless of Granade’s ruling.

One of the couples seeking to get married in Mobile, James Strawser and John Humphrey, said they were optimistic a ruling would allow them to wed.

“We’re going to get our victory,” Strawser said. “At least we can get married by the weekend.”

Contributing: The Associated Press