Amid a thundercloud of dark news this week, the Texas legislature provided a ray of light: the defeat of all five anti-transgender bills proposed in a special session convened by Governor Greg Abbott.

Most encouraging for LGBT advocates and allies, moderate Republicans, encouraged by backers in the business community, provided the margin of victory, suggesting that President Trump’s cynical efforts to divide transgender people from lesbians and gays will ultimately fail.

The special session was the pet project of Texas’s hard-right lieutenant governor, Dan Patrick. The state senate had passed his bill, S.B. 6, which was directly modeled on North Carolina’s infamous H.B. 2, and which would not only affect transgender protections but would also prohibit any city from protecting LGBT people more generally.

However, the state House’s bill was far less expansive, and the House leadership had refused to join a conference to resolve the differences. As a result, Patrick demanded that Governor Abbott convene a special session to pass a law. Abbott did so, but added a dozen other items to the agenda, making passage of an anti-LGBT law more difficult.

Notably, all of this debate took place amongst Republicans, with Patrick more or less representing the Christian Right and the House leadership representing the pro-business wing of the party.

The failure of the special session, which adjourned Wednesday, is a stunning defeat for the Christian Right in the state of Texas. And it came largely at the hands of big business.

First, a coalition of business interests—including many chambers of commerce—trotted out statistics that an anti-trans bill could cost the state $5.6 billion in lost economic investment. Such math is always fuzzy, of course, but it’s based on the economic losses experienced in North Carolina, and the forced exile of pro-LGBT businesses (the vast majority of the Fortune 500, as well as mega-events like the Super Bowl, which was held in Houston this year) from the state.

Next, the list of big names opposed to the Texas bills kept getting longer: Dow Chemical, Google, Apple, Nike, IBM, Visa, Salesforce. Fourteen CEO’s signed a letter opposing the anti-trans special session. Two business coalitions formed to oppose any anti-trans legislation, with over 100 companies signed up. The wall of Republican opposition eventually proved insurmountable.

Jeff Moseley, CEO of the Texas Association of Business, which led the corporate opposition to the bills, said in a statement that “this effort is consistent with our fundamental belief that a stronger Texas is grounded in policies and laws that foster an open, welcoming and business-friendly state for businesses, their employees and their families.”

And, of course, it wasn’t just big business. Religious leaders, cops, and transgender people themselves spoke out against the bill. Many of these were already on the left side of the aisle, of course, but the combination of lobbying and storytelling led to a striking reversal of fortune in a state which at one point had twenty anti-LGBT bills introduced at the same time.

“Defeating this discriminatory and dangerous legislation in Texas is a huge victory that will have an impact far beyond the Lone Star State,” said Kasey Suffredini, Acting CEO of Freedom for All Americans, a national organization promoting anti-discrimination bills (and, now, fighting pro-discrimination ones). “Our movement’s victory in Texas is a reminder that when people share their personal stories, stand up for their values, and support their communities, we win.”

That’s the unusual thing about the transgender debate, especially when it comes to bathrooms: one side is lying. You can support or oppose gay marriage, for example, because that’s mostly a matter of opinion. But the claims that transgender women are actually male sexual predators in disguise, or that permitting trans people to use gender-appropriate restrooms equals ‘letting boys use girls’ bathrooms’—these are just plain false.

What’s true, of course, are transgender lives themselves, anti-trans violence, the shocking spike in calls to suicide hotlines after Trump’s anti-transgender tweets, and the reality of gender identity distinct from physical anatomy.

And, increasingly, the costs of discrimination. Pro-LGBT corporate policies are profitable; according to a 2011 study, 87 percent of LGBT adults—roughly 5 percent of the population—said they’d switch to a brand that provided equal workplace benefits. Those same policies also enable companies to recruit the best employees, 5 percent of whom are LGBT, and many more of whom are straight allies who wouldn’t work for a company that discriminates.

And diversity itself, according to numerous studies, correlates with higher rates of innovation in companies—sexual and gender diversity included.

For all these reasons, as well as actual goodwill among corporate boards and leadership, LGBT equality has become embedded into the American corporate mainstream. And so, in Georgia, Indiana, North Carolina, Tennessee, and now Texas, corporate America has provided the margin of victory in stopping or slowing anti-LGBT initiatives.

And to see the business community stand up for transgender folk in particular is encouraging, given the attempts by the Christian Right to make transgender people the weak link in the LGBT equality chain.

It’s also worth putting the Texas transgender turnaround in context. Notwithstanding the well-founded economic grievances on the left, the fact is that in Trump’s America, big business is emerging as, gasp, guardians of democracy.

Cases in point: The resignations of key corporate leaders from Trump’s economic advisory councils, leading to the dissolving of the councils themselves. Corporations stepping up in the fight against climate change, in the absence of leadership from Washington. Businesses supporting more open immigration policies, at a time when the doors are swinging shut.

There is, of course, a potential dark side to these exercises of corporate power, which is the growth of corporate power itself, at the cost to individual freedom. When Google and others shut down The Daily Stormer, that’s a thrilling victory against online fascism, but also a troubling indicator of how much power a few corporations have over the free exchange of ideas. And you don’t see a lot of corporations calling for better oversight of the financial industry, fairer taxation of the ultra-rich, or increased protection of workers’ rights and safety.

But effective politics is about coalition-building, not purity tests. Progressives may oppose big business on economic, environmental, regulatory, and labor issues, but they have found common cause in resisting white supremacy, fighting climate change, and protecting the rights of sexual and gender minorities. In Texas, that alliance has just made life safer for some of the most vulnerable Americans.

And provided a glimmer of hope in an otherwise dark time.