Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A federal judge on Thursday ordered a probate judge in Alabama’s second-largest county to issue marriage licenses to gay couples. The ruling is expected to force other holdout probate judges in the state to give marriage licenses to lesbians and gays.

U.S. District Judge Callie V. S. Granade issued her order - which takes effect immediately - after hearing from lawyers for the gay couples who led the same-sex marriage lawsuit. They asked her for a broad ruling, applicable statewide, but also to force Mobile County Probate Judge Don Davis to hand out the licenses, according to AL.com.

"Plaintiffs’ inability to exercise their fundamental right to marry has caused them irreparable harm that outweighs any injury to defendant," Granade wrote, noting they had "met their burden for issuance of a preliminary injunction against the enforcement of state marriage laws prohibiting same-sex marriage."

" ... Judge Davis may not deny them a license on the ground that Plaintiffs constitute same-sex couples or because it is prohibited by the Sanctity of Marriage Amendment and the Alabama Marriage Protection Act or by any other Alabama," her ruling continued.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Confusion arose after Alabama Supreme Court Chief Justice Roy Moore, who has authored several letters against federal courts overturning gay marriage bans, issued an order late Sunday telling probate judges not to give marriage licenses to same-sex couples.

Moore argued same-sex marriage was "invalid" in Alabama though Granade had struck down the state’s gay marriage ban in late January. The U.S. Supreme Court had earlier declined to hear Alabama’s appeal of Granade’s decision and gay marriage was scheduled to begin in Alabama on Monday. But some probate judges declined to issue the licenses, citing conflicting orders.

“Judge Granade’s ruling confirms that the U.S. Constitution requires Alabama probate judges to issue marriage licenses to all qualified couples, gay and straight," said Randall Marshall, the ACLU of Alabama's legal director. "We hope state and local officials will recognize that their first obligation is to comply with our federal Constitution and will move quickly to follow the court’s ruling so that all couples in Alabama will be able to share in the dignity and protection that marriage provides.”

James Strawser, one of the plaintiffs, said he and his partner, John Humphrey, were getting married shortly. He said members of his church had shared in the moment, breaking into tears when they learned the couple could wed.

"We won it, it’s our victory," he told NBC News by phone from Mobile. "We made history. We will have the same rights as any married couple. ... We're really looking forward to this."

By Thursday, at least 22 of Alabama's 67 counties were issuing marriage licenses to gay couples, The Associated Press reported.

IN-DEPTH