Indiana Gov. Mike Pence approved changes by lawmakers to a controversial state law on religious freedom Thursday, essentially conceding defeat to a concerted alliance of liberal interest groups and large corporations over gay rights.

The new version of the law clarifies that it will not allow businesses to discriminate against gay Hoosiers, a fix that Republican backers and Pence had once argued was not necessary. Both chambers of Indiana’s legislature passed the changes to the law on Thursday, sending it to Pence for final approval. Some lawmakers said the changes still weren’t necessary from a legal standpoint, but were needed in order to stem a national uproar over the Religious Freedom Restoration Act.

Get The Brief. Sign up to receive the top stories you need to know right now. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

“The change in the RFRA law will hopefully put an end to the greatest misperception of all: that Indiana’s people discriminate, which couldn’t be further from the truth,” said Senate President Pro Tempore David Long.

But gay rights groups point out that the changes only stop discrimination that might have happened as a result of the religious freedom law. No Indiana state law explicitly bars businesses from discriminating against gay customers.

After signing the clarification bill, Pence released a statement and posted a series of tweets that announced he had done so and hoped the state could move forward.

“There will be some who think this legislation goes too far and some who think it does not go far enough,” he said, “but as governor I must always put the interest of our state first and ask myself every day, ‘What is best for Indiana?’ I believe resolving this controversy and making clear that every person feels welcome and respected in our state is best for Indiana.”

Still, the quick turnaround on the law in a Republican-led red state showed a sea change on how gay rights fights play out. The fix was the outcome of 48 hours of intense negotiations as lawmakers tried to quell concerns from companies such as Apple, American Airlines and Salesforce, as well as the NCAA college sports league and a bevy of celebrities.

But while the national fight over the bill lasted a few short days, left-leaning groups in Indiana had been laying the groundwork for months. The Human Rights Campaign, Lambda Legal and others began working with friendly Indiana lawmakers and businesses late last year, sowing the seeds of grassroots opposition as rumors of a religious freedom bill began circulating.

Without the close alliance between big Indiana businesses and liberal activists, the national outcry this week over Indiana’s new law could have been just a muffled whimper.

“This was a moment years in the making,” says Fred Sainz, vice president for the Human Rights Campaign. “The reason we are able to rely on this level of corporate support now is we’ve cultivated this garden for a long time.”

Opposition Takes Root

The Religious Freedom Restoration Act was conceived last year by conservative Indiana lawmakers who sought a bulwark in the culture war over gay rights. A proposed state constitutional amendment defining marriage as between a man and a woman petered out last year, and in October a federal court legalized same-sex marriage.

By Thanksgiving, whispers about a religious freedom bill began surfacing in Indianapolis. Lambda Legal, the national gay rights group, got a tip from a friendly legislator in the Indiana House that a bill was in the works and alerted friendly groups and businesses. Word got out that a bill was going to be completed in January, and by the end of the month, it was filed.

MORE: Uproar Over Religious Freedom Law Trips Up Indiana’s Governor

Civil rights groups primed Indiana businesses for a fight. Cummins, a major diesel and gas engine manufacturer in the state, was an early opponent of the bill. After consulting with activist groups before Christmas, the $19-billion company deployed two in-house lobbyists to try to sway Indiana state legislators against the bill. The company also used an outside lobbying firm, Krieg DeVault, to help lobby the general assembly. Activists notified Indiana companies such as Salesforce, Eli Lilly and Alcoa of the bill, who also put pressure on legislators. The Indiana Chamber of Commerce, which represents the state’s businesses interests in the state capitol, opposed the bill, as did its Indianapolis equivalent.

“The bill has been brewing since gay marriage become legal in October,” says Jim Bennett, Midwest director for Lambda Legal. “We’ve all been able to stay close together throughout this fight going back to the beginning.”

In early March, the Indiana Senate passed the Religious Freedom Restoration Act along party lines. The ACLU, the Human Rights Campaign, Lambda Legal and the American Unity Fund banded together into a group called Freedom Indiana to better coordinate opposition to the law.

Business groups scored a legislative win late in the process when they convinced the Indiana House to add an amendment that protected corporations from religiously fueled employee lawsuits. But they were unable to prevent the passage of the final bill through the general assembly.

Harsh Spotlight

The carefully tended tinder of opposition erupted into a national firestorm when Pence signed the bill into law last Thursday.

Apple’s openly gay CEO Tim Cook, whom civil rights groups had been privately courting as a key civil rights ally, tweeted his opposition. The NCAA denounced the measure as well, and additional businesses signed on to a critical letter addressed to Pence, including Internet company Angie’s List and healthcare company Roche Diagnostics. On Monday, the Indianapolis Star featured a rare front-page editorial. “FIX THIS NOW,” the headline screamed in huge letters. “Indiana is in a state of crisis,” the editors warned the governor. “It is worse than you seem to understand.”

Beset on all sides, Pence sounded the retreat on Tuesday, urging lawmakers to fix the law. “After much reflection and consultation with the leadership of the General Assembly, I’ve come to the conclusion it would be helpful to move legislation this week that makes it clear this law does not give businesses the right to deny services to anyone,” Pence said in a news conference.

MORE: 5 things to Know About Mike Pence

Even as Indiana scrambled to amend the law, the Human Rights Campaign diligently worked its corporate contacts. The group released a statement on Tuesday signed by American Airlines, Microsoft, Wells Fargo and six other major businesses that denounced similar efforts around the country. Meanwhile, left-leaning activists clamored for language that would protect LGBT Hoosiers, and lobbyists for the manufacturing, healthcare and tourism industries complained the law was bad for business. Many rank-and-file Republicans staunchly stood by the old bill as party leaders rallied their caucuses.

By Tuesday evening, the rhetoric had reached a feverish pitch. “The business and civic leaders were telling legislators yesterday that the financial impact to the city of Indy would be similar to Katrina,” said one Indiana business leader on Tuesday. “Today, they are saying it’s more like Pompeii.”

Conservatives insisted the outburst against the law was overblown and blamed the erosion of the law on outlier groups. Evangelical leader Rev. Franklin Graham wrote in a Facebook post that liberal groups “don’t want Christians’ freedoms to be protected.” Former U.S. House Speaker Newt Gingrich called the response a “lynch mob.”

Wednesday saw intensive meetings with Pence, House Speaker Brian Bosma and Long, the Senate leader, as well as sport and business leaders and lobbyists. The Star reported that Indianapolis Motor Speedway CEO Mark Miles, Indy Chamber Vice President Mark Fisher and a representative from tech company Salesforce were also involved in meetings.

A new version of the bill had coalesced by Thursday. “The message is clear today,” said Bosma. “It’s coming from Democrats, Republicans, corporate leaders, and community leaders, that Indiana is open for business to people of all stripes, and we discriminate against no one.”

The concerted opposition to the Indiana bill is likely to serve as a warning to other states. Republican Gov. Asa Hutchison of Arkansas declined to sign a similar bill Wednesday after opposition from Walmart and others, while Republican Gov. Pat McCrory of North Carolina said he would oppose any similar legislation.

Pence has professed that the hostility to the law shocked him. “Was I expecting this kind of backlash? Heavens, no,” he said.

Whatever else happens after this week, other governors won’t be able to make the same claim.

Read next: Real Progressives Should Support Indiana’s Law

Contact us at letters@time.com.