The Georgia Legislature over the course of a few hours Wednesday unveiled changes to a controversial "religious liberty" bill and gave it final passage, setting off a collision course with corporate leaders and gay rights advocates over charges that it would legalize discrimination in Georgia.

House Bill 757 now goes to Gov. Nathan Deal for his signature to become law, a culmination of two years of debate, attacks, counterattacks and emotional speeches from both supporters and opponents.

“The First Amendment and the free exercise of religious beliefs is an essential part of our democracy,” Lt. Gov. Casey Cagle, one of the bill’s staunchest backers, said after the final vote. “It deserves the utmost respect and protection. This legislation does just that and protects these freedoms.”

Corporate leaders, who publicly opposed previous versions of the bills, said they remain opposed to the bill. In a statement, the Metro Atlanta Chamber said the bill "would harm our ability to create and keep jobs that Georgia families depend upon." While the Chamber called on Deal to "maintain" his view that any religious liberty lawmakers pass not allow discrimination, the business group stopped short of calling on him to veto HB 757.

Gay rights advocates, who have worked to block the bills in the past, immediately decried the new version of HB 757 as discriminatory and a "slap in the face."

"This bill is worse than what previously passed the Senate and the House," said Maggie Garrett, an attorney with Americans United for Separation of Church and State.

“This is the first time since Jim Crow that Georgia has legalized discrimination,” said state Sen. Vincent Fort, D-Atlanta.

The bill as passed would protect the rights of faith-based nonprofit organizations to fire employees because they are gay. It says no individual could be forced to attend a same-sex marriage.

It would protect faith-based organizations from having to rent or allow its facility to be used for an event it finds “objectionable.”

These organizations, which include churches, religious schools and associations, would not be required to provide social, educational or charitable services “that violate such faith-based organization’s sincerely held religious belief.” However, it says government could enforce the terms of a grant, contract or other agreement.

It includes much of the language found in the federal Religious Freedom Restoration Act of 1993, which requires government to prove a “compelling governmental interest” before it interferes with a person’s exercise of religion.

However, it adds that it could not be used to allow “discrimination on any grounds prohibited by federal or state law.”

And it says no pastor could be forced to perform a same-sex wedding ceremony.

“There’s been a lot of time and a lot of effort from a lot of sources to get this bill where it is today,” said state Sen. Greg Kirk, R-Americus, the bill’s Senate sponsor and a former Baptist minister. “The leadership has been shown by the Georgia General Assembly that it leads the nation in dealing with the definition of marriage.

“There was a need for this law, and it took Georgia to lead the way for the country.”

Leaders of the 1.3 million-member Georgia Baptist Mission Board have led the effort for the past two years, calling on lawmakers to pass bills they said would protect religious viewpoints and prevent discrimination against religious groups. This year, for the first time, they explicitly linked the effort to same-sex marriage after the U.S. Supreme Court ruled in June that state prohibitions on same-sex marriage are unconstitutional.

But many of the bill’s opponents predicted Georgia would soon face the same kind of backlash and economic crisis that Indiana dealt with in 2015, when businesses and other groups raised enough of a ruckus to force lawmakers there to make changes.

House Speaker David Ralston, R-Blue Ridge, however, said HB 757 would not cause that sort of reaction.

“This is much more balanced,” said Ralston, who previously said he did not support any bill that would allow discrimination and cause harm to the state.

The courts, he said, will likely ultimately decide how far the bill goes and whether, for example, it overrides local anti-discrimination laws such as the one in the city of Atlanta.

Ralston and Gov. Nathan Deal had previously been the most prominent Capitol denizens to insist no bill pass that could be discriminatory.

Deal’s staff would not say whether the governor had an opinion on the new version of the bill.

“The governor has been clear on the issue and will review the legislation in April during bill review,” Deal spokeswoman Jen Talaber said.

Opponents are specifically concerned that the new version of HB 757 would uphold faith-based organizations’ ability to fire, or refuse to hire, anyone with whom they disagree on religious grounds.

“This would allow organizations to discriminate against LGBT people or single mothers who have no ministerial function within the religious organization, like a janitor, a cafeteria worker, an administrative assistant,” said Anthony Kreis, a professor at the University of Georgia and an expert in constitutional law.

Also, while it says part of the bill could not be used to violate any state or federal anti-discrimination law, it does not include local ordinances in that protective clause. There are no state or federal protections for the lesbian, gay, bisexual and transgender community, but many cities, including Atlanta, have local laws prohibiting discrimination.

The most emotional testimony over the bill came in the House, which like the Senate debated the bill for about an hour.

Its sponsor, state Rep. Kevin Tanner, R-Dawsonville, said it is the result of a "long process." The bill, he said, "will accomplish protecting those of us who live in communities that have strong faith communities and (where) people are concerned about the times we live in. At the same time, it will not allow for very overt discrimination and keep Georgia a great place to do business."

Majority Leader Jon Burns, R-Newington, said the bill strikes the proper balance.

“I cannot support in good conscience any measure that infringes on anyone’s religious liberty,” he said. “I will not support any measure that allows, directly or indirectly, the unjust treatment of others.”

But that’s exactly what the bill does, Democrats said.

State Rep. Karla Drenner, D-Avondale Estates, one of three openly gay House members, said the bill would make her a second-class citizen.

“What it says to me is that ‘There is something wrong with you, Karla. There’s something wrong with your family. There’s something wrong with your faith,’ ” she said.

It would deprive her of the same rights as others, she said.

“It says my rights under the Constitution and under the law and under God are not inalienable, but subject to the beliefs of others,” Drenner said.

Religious leaders were split on the bill’s passage.

Mike Griffin, the public affairs director for the Georgia Baptist Mission Board, praised it.

"All citizens here in the state of Georgia have won," said Griffin, whom House leaders last week accused of comparing them to Hitler for failing to move religious liberty legislation. "It's the kind of religious liberty protections all Georgians can be happy with today."

More than 300 other Georgia clergy, however, said Deal should veto the bill.

“As a person of faith, I stand firmly against this egregiously discriminatory bill because it compromises who we are as Georgians and as Americans,” said Rabbi Peter S. Berg of The Temple in Buckhead. “My faith teaches me that we are to treat others fairly, as we would wish to be treated ourselves. My faith is protected by the First Amendment.”

Georgia’s powerful corporate community and companies including Coca-Cola, Google, Home Depot and Microsoft, have opposed the bill in previous forms, saying they would have had a crippling economic impact on the state, citing threats of boycotts from both business convention organizers and national LGBT advocates.

Studies by the Metro Atlanta Chamber and the Atlanta Convention and Visitors Bureau have suggested a negative economic impact of $1 billion to $2 billion if national groups begin boycotting Georgia or canceling conventions and events based on perceived discriminatory efforts by the state.