For a moment, the guns have gone quiet in the latest front in America's seemingly never-ending culture wars.

At the last minute, on Thursday night, the US states of Indiana and Arkansas pulled themselves back from the brink by refusing to pass unamended legislation which had been condemned across the nation as anti-gay and discriminatory against the lesbian, gay, bisexual and transgender community.

Rarely before in US history has there been such an outcry mounted by a cross-section of church, business, sporting and entertainment leaders against bills which were promoted as defending religious freedoms but which were roundly criticised at the same time as being anti-libertarian in tone and intent.

If bad laws are legislation which has been passed too quickly then Indiana and Arkansas were in danger of subjecting themselves to measures they would come to regret. Last week, amid scenes of panic and mutual recrimination, the governors of both states were about to sign off new laws which were condemned by civic and business leaders as being overly discriminatory and reactionary. Both are versions of the existing federal Religious Freedom Restoration Act.

The opposition was not just confined to church leaders and other libertarian organisations: amongst the most strident critics were the retail giant Walmart which has its headquarters in Arkansas and the clothing manufacturers Gap and Levi Strauss which have powerful business interests in both states. Among the individual critics were Tim Cook, CEO of Apple, the novelist Stephen King and pop star Cher. Even Seth Hutchinson, son of Arkansas governor Asa Hutchinson, was moved to tell his father that it was a flawed piece of legislation and that he should not sign it.

Their main objection was that the new law would allow businesses and other organisations to discriminate unfairly against gays and lesbians on religious grounds. At the same time conservative supporters of the two bills claim that it simply mirrors a federal law that prevents the government from "substantially burdening" a person's exercise of religion unless there is a "compelling interest".

In other words, here was a classic American culture clash of interests with lawmakers claiming that they were simply upholding existing religious beliefs such as stopping the government from compelling people to do things they object to on religious grounds, such as catering or providing flowers for a gay wedding.

At the same time opponents countered that it was repressive legislation which was anti-gay in tone and content and would simply fuel existing prejudices.

"These bills rationalise injustice by pretending to defend something many of us hold dear," argued Apple boss Tim Cook last week. "They go against the very principles our nation was founded on, and they have the potential to undo decades of progress toward greater equality."

Others were equally vocal with an array of business, sporting and entertainment figures threatening to withdraw plans to invest in Indiana or Arkansas or even to travel to either state. Suddenly it seemed as if both states could be closed for business in the immediate future.

This unprecedented display of opposition to the legislation brought a surprisingly quick result. On Thursday night in Indiana, legislators passed a series of alterations clarifying that changes to the religious freedom law would not permit anti-gay discrimination.

While this does not outlaw such behaviour at least it brings the legislation in line with the federal Religious Freedom and Restoration Act.

Inevitably perhaps, the same critics argued that the changes did not go far enough, while supporters of the bill countered that the watering down was unnecessary and "unhealthy for God-faring Americans."

After a lengthy and frequently acrimonious debate the Indiana House of Representatives passed the amended bill by 66 votes to 30, and the Senate by 34 to 16, leaving Governor Mike Pence free to sign the revised version.

Similar scenes were being enacted at the same time in Arkansas where the state legislature also agreed to re-examine the offending bill and where Governor Hutchinson was under increasing pressure - not least from his son - to use his veto.

With time running out and with the bill unsigned on his desk, he urged his officials to look again at the wording and to come up with a version which would be similar in tone and effect to the existing federal law.

It was a close-run thing, but late on Thursday the legislature voted overwhelmingly and with broad bipartisan support for the new version which Governor Hutchinson signed that night, making it law.

"The fact that it might not solve every problem for everyone probably means it's a good bill," he said after signing.

BATTLEGROUNDS IN THE FIGHT OVER FREEDOM

Indiana and Arkansas found themselves at the epicentre of the latest legal controversy to hit the Religious Freedom Restoration Act, a complex piece of legislation which, depending on interpretation, seems to allow businesses and other organisations to discriminate against lesbian, gay, bisexual and transgender (LGBT) people. The states in question vary in make-up and in their geographical locations, Indiana being one of the great Midwestern states with links to the wealth of the Great Lakes, while Arkansas is often characterised as a backward, southern, cotton-picking, hill-billy state.

In fact, both are predominantly white, Christian and conservative in their attitudes. During the 1950s Arkansas was in the world's spotlight when its capital Little Rock was the focus of the civil rights movement and President Dwight D Eisenhower had to deploy forces to protect African-American students attempting to gain admission to local high schools.

Although the governor and city council attempted to evade the problem by forcibly closing the schools, full integration was in force by the end of 1959.

Indiana has a more settled history. Although it suffered during the Great Depression of the 1930s, the "Hoosier" state recovered quickly and has a settled economy based largely on manufacturing and agriculture. Traditionally a Republican stronghold, it also tends to uphold conservative principles and the state has strong military and sporting interests.

In contrast to that staid perception, the state is also respected for its openness to new ideas and there has been widespread bemusement about the national response to the passing of the legislation. The state is proud of its reputation for "Hoosier hospitality" and in the 2008 presidential election it voted for Barack Obama, although republican Mitt Romney won it back four years later.

Some idea of the contradictions inherent in this case can be found in the decision by the Indianapolis-based Christian Church to pass a resolution asking the governor to veto the bill as they believe it to be "contrary to the values of our faith, as well as to our national and Hoosier values".

According to the National Council of State Legislatures, 20 US states have already passed so-called religious freedom laws - they include Connecticut, Florida, Oklahoma and Texas - and another dozen are due to follow suit this year. They are modelled on a federal law which was signed by President Bill Clinton in 1993 after being passed in Congress without very much objection. At the time Clinton said the new law would subject the government to "a very high level of proof before it interferes with someone's free exercise of religion."

It is on this question of interpretation that the act ran into trouble, and legislation due to be introduced later this year has already stalled. Georgia and North Carolina are high-profile examples of where there could be a repetition of the current woes which faced Indiana and Arkansas last week.

HOW THE AMERICAN LEFT AND RIGHT TURNED ON EACH OTHER OVER ... PIZZA

Pizzas and wedding photographs have become an unlikely battleground in the fight for the acceptance or rejection of new controversial US state legislation based on the federal Religious Freedom Restoration Act (RFRA) of 1993.

On the face of it, both are unlikely flashpoints but when Memories Pizza in the small Indiana town of Walkerton (population 2,200) announced that it would not cater for gay weddings, citing the new religious freedom law, all hell broke loose.

Pizzeria owner Kevin O'Connor was quite clear where he stood: he was happy to cater for most folks' tastes but his family felt that they had to draw the line somewhere.

Speaking to the local television station, his daughter Chrystal made a blunt and uncompromising announcement: "If a gay couple came in and wanted us to provide pizzas for their wedding, we would have to say no."

There were two reactions to the O'Connor's decision and both indicate the confused strength of feeling that has been whipped up by the public discussion of religious freedoms and sexual preferences.

In the aftermath of Chrystal O'Connor's statement, the pizzeria was forced to close its doors after it came under sustained attack from threatening phone calls and hostile social media postings. According to the firm's website, each working day begins with morning prayers but that proved no protection against the internet trolls who redoubled their efforts by inserting a Nazi photograph on the website with the message

"Hitler Approves".

But that was not the end of the story. Enraged religious conservative supporters rallied to the aid of O'Connors and raised $400,000 in a fundraising effort which not only showed solidarity but also backed the whole concept of the RFRA. Much of the backing came from the Catholic League for Civil and Religious Rights.

Things turned out a little differently in New Mexico when last week the US Supreme Court rejected an appeal to overturn a state decision to fine a local firm, Elane Photography, which had refused to take photographs at a same-sex commitment ceremony between Vanessa Willock and Misti Collinsworth.

The photographers Jonathan and Elaine Huguenin claimed that any participation in the ceremony would have violated their Christian

beliefs and as a result they were fined for engaging in discriminatory

business practices, a decision

which was upheld by the Washington court.

Although the local battle was lost, the war continues as the case was supported by the Alliance Defending Freedom, a conservative legal group which specialises in defending businesses accused of discriminating against same-sex couples.

Alan Sears, the president of the group and the author of the book The Homosexual Agenda: Exposing the Principal Threat to Religious Freedom Today, vowed to continue to fight on behalf of those who believe that legislation should protect their beliefs in dealing with those involved in same sex relationships. Sears said. "The trail blazed by Elane Photography will not be in vain."