Two presidential hopefuls campaigning for the Republican nomination are defending a Kentucky county clerk jailed for contempt this week after refusing to follow a federal judge's orders to issue marriage licences to same-sex couples.

Kim Davis, the county clerk, refused to co-operate with a judge's ruling to hand out the licences because she says "God's moral law conflicts with my job duties."

U.S. District Judge David Bunning, who jailed her, reasoned that "her good faith belief is simply not a viable defence."

But two possible future presidents, former Arkansas governor Mike Huckabee and Senator Ted Cruz, disagree. They have declared #ImWithKim in what they deem a battle for religious liberty.

#ReligiousLiberty defence

Huckabee wrote an open letter on his campaign site calling for Davis's release that his supporters and others can co-sign.

The letter, which is addressed to U.S. President Barack Obama, Attorney General Loretta Lynch and Judge Bunning, calls for Davis's immediate release.

"Exercising religious liberty should never be a crime in America. This is a direct attack on our God-given, constitutional rights," the letter signed by Huckabee reads.

He took to Twitter to promote the letter and his stance on Davis's incarceration.

He said the judge's decision to jail Davis "removes all doubts about the criminalization of Christianity" in the U.S. and called on others to "defend #ReligiousLiberty!"

Kim Davis in federal custody removes all doubts about the criminalization of Christianity in this country. We must defend <a href="https://twitter.com/hashtag/ReligiousLiberty?src=hash">#ReligiousLiberty</a>! —@GovMikeHuckabee

He wondered who might be jailed next for refusing service to same-sex couples. "Pastors? Photogs? Caterers? Florists?" he asked.

Proud of <a href="https://twitter.com/hashtag/KimDavis?src=hash">#KimDavis</a> for standing strong for her beliefs. Who's next? Pastors? Photogs? Caterers? Florists? <a href="http://t.co/fYxFEng5gH">http://t.co/fYxFEng5gH</a> <a href="https://twitter.com/hashtag/ImWithKim?src=hash">#ImWithKim</a> —@GovMikeHuckabee

The decision "undermines the Constitution" and the "fundamental right" of religious liberty," he wrote.

This reckless, appalling, out-of-control decision undermines the Constitution & our fundamental right to <a href="https://twitter.com/hashtag/ReligiousLiberty?src=hash">#ReligiousLiberty</a>. <a href="https://twitter.com/hashtag/ImWithKim?src=hash">#ImWithKim</a> —@GovMikeHuckabee

Judges, Huckabee believes, "cannot make law. They can only make ruilngs."

Five, unelected Supreme Court lawyers did not and cannot make law. They can only make rulings. <a href="http://t.co/fYxFEmYup9">http://t.co/fYxFEmYup9</a> <a href="https://twitter.com/hashtag/ImWithKim?src=hash">#ImWithKim</a> <a href="https://twitter.com/hashtag/KimDavis?src=hash">#KimDavis</a> —@GovMikeHuckabee

His Twitter rant may be no surprise to supporters. Huckabee, who lists family values on his website as a campaign issues, believes in what he calls "traditional marriage."

"I may stand alone, but I am absolutely faithful to the issue of marriage. Not because it's politically expedient, but because it's the Biblical position, the historical position and the right position. We must defend, protect and preserve traditional marriage," he wrote on his site.

Cruz's historical flub

One of his opponents in the race for the Republican nomination, Cruz, also publicly defended Davis.

On Thursday, Cruz gave a speech at the Nathaniel Center for Cultural and Biblical Education in Kingwood, Texas. Christopher Hooks, a journalist with the Texas Observer, captured some of his controversial comments about Davis during that speech.

"Today for the first time in history a Christian woman was put in jail for standing up for her beliefs," Cruz said.

"Today for the first time in History a Christian woman was put in jail for standing up for her beliefs," says Cruz. <a href="http://t.co/CBhNlGFuTn">pic.twitter.com/CBhNlGFuTn</a> —@cd_hooks

It didn't take much effort to fact check that statement. Many people on Twitter quickly pointed out prominent examples of Christian women jailed for standing up for their beliefs before Davis.

Women like Rosa Parks.

<a href="https://twitter.com/cd_hooks">@cd_hooks</a> Rosa Parks - a devout Christian who went to jail for her convictions and civil rights. <a href="http://t.co/PQEotmGFuq">pic.twitter.com/PQEotmGFuq</a> —@chazzdaddy

Or Joan of Arc (who was executed by being burned alive on a stake).

<a href="https://twitter.com/cd_hooks">@cd_hooks</a> What about, like, Joan of Arc? —@overlayered

<a href="https://twitter.com/cd_hooks">@cd_hooks</a> Joan of arc, you were burned as a heretic and I'm a let you finish but Kim Davis is the best Christian woman of all time! —@samanjj

Not to be outdone by Huckabee, Cruz also penned an open letter on his site and called "upon every believer, every constitutionalist, every lover of liberty to stand with Kim Davis."

In the letter, he re-iterated his historical flub.

"Today, judicial lawlessness crossed into judicial tyranny. Today, for the first time ever, the government arrested a Christian woman for living according to her faith," he wrote. "This is wrong. This is not America."

He tweeted a link to the letter multiple times, including once with a video of his appearance on The Kelly File defending Davis.

In the video, he calls the situation "an outrage."

I stand with Kim Davis. Add your name if you do too: <a href="https://t.co/zyBRG91OXG">https://t.co/zyBRG91OXG</a> <a href="https://t.co/df3vURucZ4">https://t.co/df3vURucZ4</a> —@tedcruz

Calls for Obama to resign

Cruz and Huckabee both also called for multiple other leaders to resign or be jailed.

Huckabee wondered why Hillary Clinton, who is seeking the Democratic nomination for the 2016 presidential race, hasn't been jailed.

What a world, where Hillary Clinton isn't in jail but <a href="https://twitter.com/hashtag/KimDavis?src=hash">#KimDavis</a> is. <a href="https://twitter.com/hashtag/ImWithKim?src=hash">#ImWithKim</a> —@GovMikeHuckabee

As well as San Francisco government officials.

<a href="https://twitter.com/hashtag/KimDavis?src=hash">#KimDavis</a> in jail for not issuing same-sex wedding licenses. Why aren't San Fran officials in jail for ignoring immigration law? <a href="https://twitter.com/hashtag/ImWithKim?src=hash">#ImWithKim</a> —@GovMikeHuckabee

Cruz called on the nation's leader to resign.

Cruz says: If Davis should resign, Obama should resign (and mayor of San Fran, who is no longer in office) —@cd_hooks

Where’s the call for Pres. Obama to resign for ignoring & defying immigration law, welfare reform law & Obamacare? <a href="https://t.co/iyrWbPLgoR">https://t.co/iyrWbPLgoR</a> —@tedcruz

Online backlash

Many people did not take kindly to their public support of the county clerk, who they said was not being persecuted for her religious beliefs but rather for breaking the law by not issuing marriage licences after the U.S. Supreme Court legalized same-sex marriage in all 50 states.

<a href="https://twitter.com/GovMikeHuckabee">@GovMikeHuckabee</a> Not about religious liberty, Mike. You can try to make it about that all you want - it never will be. —@SkepticalCactus

<a href="https://twitter.com/GovMikeHuckabee">@GovMikeHuckabee</a> Kim Davis has the religious freedom. She has the freedom to quit her government job that's against her religion —@TheLukeShort