Kentucky clerk Kim Davis is facing another legal challenge after she interfered, once again, with the issuance of marriage licenses in Rowan County.

Davis was placed in federal custody after she refused to let her office issue any marriage licenses, as required by state and federal laws, citing her religious opposition to now-legalized same-sex marriages. But she was released after deputy clerks began issuing licenses while Davis was in jail — on the condition that Davis didn't interfere once she got out. And Davis has so far allowed the deputies to issue licenses, but only after changing the marriage licenses to note they're being issued in accordance with a federal court order, instead of with her approval.

BREAKING: William Smith and James Yates just obtained a marriage license from the Rowan County Clerk's Office. pic.twitter.com/rBcxunFZxb — Dominic Holden (@dominicholden) September 4, 2015

Davis previously defied previous federal court orders for her office to issue marriage licenses — citing "God's authority" and her religious objections to marriage equality — after the Supreme Court in June upheld marriage equality. Her stand drew nationwide attention, becoming ground zero for the broader battle between religious conservatives and advocates of marriage equality.

This battle wasn't unexpected: Before the Supreme Court upheld the legality of same-sex marriages nationwide, LGBTQ advocates said it was likely that some local and state officials would drag their feet in enforcing the ruling. But it was remarkable that one Kentucky clerk continued to drag her feet even after multiple federal courts, including the Supreme Court, rejected her request to do so.

Kim Davis has rejected court rulings and orders every step of the way

In response to the Supreme Court's June 26 ruling legalizing same-sex marriages nationwide, Davis's office stopped issuing marriage licenses to opposite-sex and same-sex couples — due to objections that her name would appear on same-sex couples' marriage licenses, which she took as a sign of approval of the marriages. In theory, stopping all marriages protected Davis's office from discrimination claims since it's denying everyone a marriage license, not just same-sex couples.

But Kentucky Gov. Steve Beshear's office said that clerks have a legal duty to issue marriage licenses, and told county clerks to do so or resign. And a federal court concluded, drawing on previous Supreme Court rulings, that the 14th Amendment's Due Process clause protects the fundamental right to marry — suggesting Davis's refusal to issue marriage licenses is a violation of federal law.

Davis appealed to federal courts to exempt her office from issuing marriage licenses. Federal courts denied her request, and she went to the Supreme Court, which on August 31 denied her request as well. With that, a lower federal court's order that her office issue marriage licenses kicked in.

When asked under what authority she's operating, Davis said, "God's authority"

But on September 1, Davis's office opened and continued refusing to issue marriage licenses. When asked under what authority she's operating, Davis — who's an Apostolic Christian — said, "God's authority."

In response, lawyers representing the couples looking to marry filed a motion to find Davis in contempt of court for violating federal court orders to issue marriage licenses.

"I've weighed the cost and I'm prepared to go to jail, I sure am," Davis told Fox News's Todd Starnes. "This has never been a gay or lesbian issue for me. This is about upholding the word of God."

On September 3, US District Judge David Bunning found Davis in contempt of court, sending her to jail until she allowed her office to issue marriage licenses. Bunning also warned that deputy clerks could face jail time and fines if they don't issue marriage licenses — and five of six said they're willing to do so, and began issuing the licenses on September 4. But Davis said she wouldn't allow them to grant the licenses if she was released, forcing Bunning to keep her in jail until her office began issuing marriage licenses again.

On September 8, Bunning ordered Davis's release from jail — on the condition that she doesn't interfere with deputy clerks issuing marriage licenses. The order warned that if Davis does interfere, she will be punished accordingly.

Davis appeared to comply after her release, although she confiscated old forms for marriage licenses and forced her deputy clerks to issue new ones that say they were issued by a "Notary Public" and "Pursuant to Federal Court Order #15-CV-44 DLB" instead of issued by Rowan County or Davis herself. The ACLU filed another legal challenge over this change, arguing that the marriage licenses were altered so greatly that they may not stand up to legal scrutiny.

Even if the new marriage licenses are legally valid, Davis might still be in violation of the federal court order. As Georgetown Law professor Marty Lederman at the blog Balkinization wrote, Bunning ordered Davis to "not interfere in any way, directly or indirectly." Forcing her deputy clerks to issue altered forms for marriage licenses certainly seems like interference. But it's unclear if a court will actually punish Davis for it.

Why hasn't Kim Davis been fired?

Because Davis, a Republican (former Democrat) elected in 2014, is an elected official, and elected officials can't be fired.

Kentucky lawmakers could impeach her. But the state legislature seems unlikely to do that: It's currently not in session, and it's fairly conservative.

It might be possible, the New York Times reported, to charge her with official misconduct, which could result in a court order to remove her from office if she's convicted. But Kentucky's attorney general refused to pursue that possibility.

Kim Davis's religious objections don't legally justify discrimination or let her avoid her legal duty

At the heart of this back-and-forth is a single question: Can government agencies cite religious beliefs to refuse to let same-sex couples marry, and essentially use faith to discriminate against gay people? So far, courts have responded with a resounding no. But that hasn't stopped state and local officials from trying various tactics in hopes of finding some sort of loophole in the Supreme Court's marriage equality ruling.

Davis has repeatedly defended her actions by citing her religious beliefs. She released a statement on September 1 describing this issue as "a Heaven or Hell decision" for her, claiming, "I was elected by the people to serve as the County Clerk. I intend to continue to serve the people of Rowan County, but I cannot violate my conscience."

But courts have decided that Davis's religious objections can't get in the way of her office performing its secular, legal duties. While she may personally object to same-sex marriages on religious grounds, it's her office's legal duty to issue marriage licenses — even to same-sex couples, who are now guaranteed the same marriage protections thanks to the Supreme Court's decision earlier this year.

"I intend to continue to serve the people of Rowan County, but I cannot violate my conscience"

The developments so far fall firmly within legal experts' expectations of how these kinds of issues will play out if clerks continue trying to deny marriage licenses to same-sex couples. While government agencies can take some steps to allow individual officials to avoid violating their religious beliefs, the government is ultimately obligated to let same-sex couples marry to avoid discriminating against gay people.

Here's how it should typically work: If a same-sex couple shows up at a county clerk's office to get married, an individual official can refuse to grant them a license. But the official would have to hand the case over to another county staffer, who would then give the license to the couple. The issue is that individual government employees may refuse — based on genuine religious objections — to participate in a same-sex couple's marriage, but the county government as a whole has a compelling interest to accommodate the couple and avoid violating their constitutional right to marry.

"The conscientious objector clerk and the clerk who is willing to issue the license need to just trade places," Douglas Laycock, an expert on religious freedom laws at the University of Virginia School of Law, wrote in an email in July. "I don't think the county could require the same-sex couple to go stand in a different line, or come back on a different day."

This can get more complicated — as it did in Texas — if everyone in a county clerk's office refuses to let a same-sex couple marry. In that case, the county would have to find a way to accommodate the couple or risk violating the Supreme Court's ruling.

"If the situation arises, someone has to issue the license," Laycock explained. "I would think the responsibility falls on the elected clerk. … But the county has a constitutional duty, and there is a compelling government interest in requiring someone to perform that duty."

Kim Davis was offered a religious accommodation

In Rowan County, the situation was more complicated. Davis's office was refusing to issue any marriage licenses, which let her office say it wasn't discriminating against same-sex couples, since no one — not even opposite-sex couples — could obtain marriage licenses. But even that defense didn't work: Gov. Beshear's office concluded that it's a clerk's legal duty to issue marriage licenses, and a federal court agreed, so Davis was violating her clerk's oath to uphold the law by stopping her entire office from issuing marriage licenses to anyone.

Still, Davis was offered an accommodation: She could let her deputy clerks issue marriage licenses, while she excuses herself from the process. She refused at first, saying she would interfere if she was released from jail. That suggested Davis didn't just want to excuse herself from issuing licenses to same-sex couples, but wanted to be able to impose her religious beliefs on her whole office — and, as a result, the entire county government. So the judge kept her in jail to stop her from interfering.

Davis's attorney said the accommodation isn't enough

A federal judge eventually released Davis from jail under this type of accommodation: As long as Davis doesn't interfere with her deputy clerks issuing marriage licenses, she won't be jailed or punished again. So Davis doesn't have to violate her religious principles and directly issue licenses to same-sex couples, but her office does.

Mat Staver, Davis's attorney, originally said the accommodation isn't enough, because state law still indicates that Davis's name should be present on the marriage licenses. But Davis ultimately allowed deputy clerks to issue licenses without her name, instead noting that the licenses were issued by a "Notary Public" and "Pursuant to Federal Court Order #15-CV-44 DLB."

LGBTQ advocates expect these types of battles to continue for some time as opponents of same-sex marriages try to find a way to avoid the Supreme Court's landmark ruling. But it's going to be a difficult, if not impossible, fight for religious opponents: Courts have repeatedly found that officials and private citizens can't cite religious beliefs to essentially ignore laws that the government has a secular, compelling interest to enforce.

Opponents of marriage equality have come to the Kentucky clerk's defense

Some conservative and religious opponents of same-sex marriages have rallied around Davis, presenting her as a martyr for their cause.

The National Organization for Marriage (NOM), an anti-LGBTQ group, issued a statement to supporters arguing that "Kim Davis is why we must fight":

Her name is Kim Davis. She's a public servant, an elected clerk in Rowan County, Kentucky. And a Christian. She is now the reluctant face of the marriage movement, the latest victim of gay intolerance and government discrimination and persecution of marriage supporters. When Kim was elected, there were no gay 'marriages' being conducted in Kentucky. But then the US Supreme Court upended the law, illegitimately redefining marriage in the law to strip it of its essential gender complementarity. This puts Kim Davis in a terrible spot because it's she, personally, whose name is on a marriage license in Rowan County and whose signature attests that the couple is indeed married. The trouble is that two men cannot be married to each other, nor two women — regardless of what any court states.

NOM argues that the Supreme Court and lower courts have violated the law by upholding same-sex couples' right to marry. At the root of this issue is the organization's belief that marriage can't be redefined and people can't be asked to violate their religious principles. Davis gives a face to that struggle, exemplifying the fear that an overreaching government will try to unconstitutionally enforce an agenda that violates people's religious beliefs.

To show their support, NOM and other anti-LGBTQ advocates, including Republican presidential candidate Mike Huckabee, held a rally for Davis on September 8.

But courts have been firm in deciding that government agencies have to carry out their legal duties regardless of individual officials' religious beliefs. As much as the Constitution protects Americans' right to worship as they please, it also establishes a separation between church and state — and that means government agencies can't justify institutional discrimination against gay people by citing their faith.