Hurricane Harvey blew the steeple off of Rockport First Assembly of God in Rockport, Texas. Harvest Family Church in Cypress got covered in a layer of mud and silt. Three feet of water filled the sanctuary of Hi-Way Tabernacle in Cleveland.

Despite this damage, the Tabernacle has served as an emergency staging area for government relief efforts in the aftermath of the storm, providing shelter for evacuees, emergency meals for families, and storage for food, water, clothing, and hygiene products. And despite the chaos, Hi-Way Tabernacle and these two other churches are involved in another effort: suing the federal government.

According to the stated policy of the Federal Emergency Management Agency, or FEMA, houses of worship cannot receive funding from the agency’s public-assistance program, which provides money for emergency fire and rescue services, medical care, urgent debris removal, and critical utility repairs in the wake of disasters. The three churches’ lawsuit is intended to challenge that rule and give religious organizations and other non-profits equal eligibility for this kind of FEMA funding. The case can also be read as a bid to expand the reach of a recent Supreme Court ruling on church-state funding, which if it succeeds, would have consequences far beyond Texas.

Faith-based organizations, including churches, synagogues, and mosques, provide an extraordinary amount of support during natural disasters. Greg Forrester—the president and CEO of the National Voluntary Organizations Active in Disaster, an association of relief groups—told USA Today that non-profits are responsible for 80 percent of recovery efforts, and most of those are faith-based. Religious groups that largely serve a secular purpose in their broader communities are eligible for funding. But those that spend more than half of their time and resources on worship, outreach, religious education, or internal fundraising aren’t eligible—a rule that effectively excludes all houses of worship.

“We’re just picking up the pieces like everyone else. And we just want to be treated like everyone else,” said Paul Capehart, the pastor of Harvest Family Church, through his lawyers. “Our faith is what drives us to help others. Faith certainly doesn’t keep us from helping others, and we’re not sure why it keeps FEMA from helping us.” While churches are leading the legal case, Jewish groups including the Orthodox Union are also lobbying for a policy change, according to The Jerusalem Post.

On Friday, President Trump tweeted his support for churches caught in disasters.

At least one FEMA official publicly cheered his pronouncement: “Amen!” replied Jamie Johnson, the director of the Center for Faith-Based and Neighborhood Partnerships at the Department of Homeland Security, where he focuses on disaster relief.

The president’s tweet “was a very good development,” said Daniel Blomberg, a lawyer who is representing the churches through Becket, an educational and legal institute focused on religious freedom. “All the churches are asking for is that when FEMA is making a determination, it’s no longer using religion as a criteria to keep parts of the community from asking for equal disaster relief.”

The timeline for FEMA funding is tight. The president has to declare an emergency or national disaster, and affected organizations generally have to request public assistance within 30 days. In their lawsuit, the three Texas churches requested expedited relief, arguing that they only have until that 30-day deadline—September 26—to win protection “against FEMA’s discrimination.”

Theoretically, the president could just direct FEMA to make all religious organizations eligible for funding under the public-assistance program. After all, FEMA is a federal agency under his authority. Similar things have happened in the past: In the wake of Hurricanes Rita and Katrina in 2005, the Bush administration agreed to reimburse religious organizations for the shelter, food, and supplies they provided to the general public.

“This seems to be policy that is made disaster by disaster.”

The Trump administration “could go ahead and do it,” said Robert Tuttle, a professor at George Washington University Law School. But the problem is that “this seems to be policy that is made disaster by disaster.” Even if the president directs FEMA to do something, the agency could later face lawsuits for doing so. In this case, critics could argue that such funding violates the Establishment Clause of the First Amendment of the Constitution.

This, however, is the strategic brilliance of the Texas church lawsuit. If the churches win an injunction or the government loses in court and FEMA is directed to give out money to churches, there’s “no guarantee that … the government will appeal,” said Tuttle. By then, the funds would have already been disbursed, and it would be up to an outside group like Americans United for the Separation of Church and State to challenge the decision—and find itself in the politically tenuous position of trying to take money away from churches that got destroyed in a hurricane.

The churches’ lawsuit relies heavily on a recent Supreme Court decision, Trinity Lutheran v. Comer. In that case, a Missouri church sued the state for excluding it from a playground-resurfacing program on religious grounds. Seven of the nine justices found in favor of the church. “Trinity Lutheran is, in some ways, a closer case than this one,” argued Blomberg. While the church in that case was asking to be part of a program that would enhance its facilities, “no one is asking for the church to be improved” in Houston, he said. “They’re just trying to get back on their feet [and] … get to a place where they’re no longer a public-health and public-safety hazard.”

It’s not clear how broadly the Supreme Court justices intended for Trinity Lutheran to be applied, or whether they would see these cases as similar. “I am deeply skeptical of that analogy,” said Tuttle. Two things distinguish this case from Trinity Lutheran, he argued. In the majority opinion for that case, Chief Justice John Roberts noted that the decision doesn’t reach the question of “religious uses of funding,” meaning that it might not apply in cases where state funding goes to rebuild a literal sanctuary used for worship. The second difference, argued Tuttle, is that it’s not clear that the three Texas churches would be eligible for FEMA funding even if they weren’t houses of worship. The agency’s public-assistance program only covers certain kinds of immediate relief. Other, non-critical repairs are generally referred to the Small Business Administration, which provides disaster-recovery loans. Organizations can get FEMA money for permanent repair work if the SBA turns them down or doesn’t cover all of the damages.

“It’s the kind of thing that we might cook up so that we can put it on exam questions.”

Constitutionally speaking, “the real question comes down to whether this is framed as a public-safety, emergency-relief action or whether it’s framed as helping a church get a new building,” said Richard Garnett, a professor of law and political science at the University of Notre Dame. “Nobody thinks it’s unconstitutional for a fire truck to put out a fire at a church, and clearly there aren’t different Establishment Clause rules for fires and floods. But are there different rules for putting out fires and repairing a building after it burns?”

Harvey, Irma, and other recent disasters have created a strong legal test case—“it’s the kind of thing that we might cook up so that we can put it on exam questions,” said Garnett. Tuttle offered a slightly more cynical read: “Lawyers are taking this opportunity to try to get relief for these particular congregations—and at the same time, to extend the reach of Trinity Lutheran,” he said. Blomberg described it differently: Becket has been pushing against FEMA’s church policy for years, he said, and Trinity Lutheran was just a sign that the law is moving in the right direction, at least in its view.

In weighing in on the case in Texas, Trump wasn’t just commenting about a few specific churches. He intervened in a long-standing debate about the proper line between church and state in public funding. In an instant, the president could change the terms of the debate, but “whether or not it’s constitutionally permissible doesn’t hinge on whether the president supports it or not,” Garnett said. A change to FEMA’s policy would not be the end of the storm—legally or otherwise. As the churches say in their lawsuit: “Mold will not wait for litigation process to spread through the churches’ buildings; storm and flood debris will not stop rotting while the government processes their claims.”