President Trump has threatened to withhold all federal funds from so-called sanctuary cities–municipal governments that do not enlist their police departments in the president’s mass deportation plan. If he makes good on his threat, cities that insist on maintaining their sanctuary status can offset revenue losses with two policies: liberalizing land-use regulation and depoliticizing public land sales.

It’s unclear exactly how much money each city would lose by maintaining its sanctuary status, but New York City, to name one example, relies on federal funding for 10% of its budget, according to state comptroller estimates. A sudden drop of that magnitude would devastate many jurisdictions, and Miami-Dade County has already caved. However, a handful of cities with high rents and very restrictive land-use regulations could dramatically increase property tax revenue and the value of city-owned real estate through liberalization.

Millions of Americans would love to live in cities like New York, Los Angeles, San Francisco, Seattle, San Jose, Austin, Portland, and Denver, but legal restrictions on what can be built limit the number of housing units available and increase the cost of each unit. Some estimates have found that regulation alone accounts for fifty percent of the cost of housing in San Francisco.

At the same time, land-use regulation has the opposite effect on the price of land itself. A plot of land with limited legal potential for development is worth much less than a plot a developer could use to build a large, lucrative building. Economist Keith Ihlanfeldt has found that the decrease in land values more than offsets the increase in home prices—meaning some cities are decreasing potential revenues by restricting development.

San Francisco has large neighborhoods of single-family homes where rent levels would sustain large apartment towers. The drastic mismatch between what is currently allowed and what consumers demand suggests that land values would skyrocket if restrictions were relaxed. The taxes levied on this land would in turn boost revenue and help the city weather the president’s fiscal attack.

In addition, city-owned plots of land–typically vacant lots and obsolete government buildings–will drastically increase in value. It’s common for local governments to sell land, even in good times, but the transactions aren’t always profitable because sales are politicized.

It’s not uncommon for major cities to transfer extremely valuable land to developers for next to nothing or, in some cases, pay private developers millions of dollars for such transfers. In Washington, D.C., for example, the District sold a parcel of land worth $12 million to developers for a measly $127,295 because the city imposed so many additional requirements above and beyond zoning—subsidized housing, community areas—that the land was worth almost nothing.

Local politicians turn down large paydays because they would rather micro-manage the development of these parcels. In this case, they insist the land be used for pet projects rather than more profitable options. Politicians are fond of this process because it allows them to curry favor with developers, pay back political allies, and effectively spend public money without any funds leaving city coffers.

City governments can solve this problem by auctioning city-owned land rather than overseeing the development of these assets. An auction, especially when done following deregulation measures like upzonings or air rights sales, would bring in more revenue because the prices paid by private developers would reflect how much the land is worth at it’s most profitable use. Utilizing auctions does mean that politicians give up some of their political goals for the sake of revenue. But the benefits of these goals, such as “inclusionary zoning” and other subsidized housing schemes, are often questionable at best.

The stakes, meanwhile, of not maximizing these public assets are huge. It’s likely that, even amid Trump’s intimidation tactics, many cities will maintain their sanctuary status, since a large percentage of their workforce and entrepreneurial base are undocumented, and deporting these immigrants would be economically ruinous. Assuming that this decision robs sanctuary cities of federal funding, liberalizing land-use regulation and selling city-owned property at auction could give them a revenue windfall to offset the losses. And it would mean, at least for a few years, helping these cities protect undocumented immigrants from deportation.