LEAVENWORTH, Kan. — Leavenworth, Kansas, occupies a mythic space in American crime, its name alone evoking a short hand for serving hard time. The federal penitentiary housed gangsters Al Capone and Machine Gun Kelly in a building so storied that it inspired the term “the big house.”

Now Kansas’ oldest city could soon be detaining far less famous people, migrants swept up in President Donald Trump’s promise of mass deportations of those living in the U.S. illegally. The federal government has signed a deal with the private prison firm CoreCivic Corp. to reopen a 1,033-bed prison in Leavenworth as part of a surge of contracts U.S. Immigration and Customs Enforcement has issued without seeking competitive bids.

ICE has cited a “compelling urgency” for thousands more detention beds, and its efforts have sent profit estimates soaring for politically connected private companies, including CoreCivic, based in the Nashville, Tennessee, area and another giant firm, The Geo Group Inc., headquartered in southern Florida.

That push faces resistance. Leavenworth filed a lawsuit against CoreCivic after it tried to reopen without city officials signing off on the deal, quoting a federal judge’s past description of the now-shuttered prison as “a hell hole.” The case in Leavenworth serves as another test of the limits of the Republican president’s unusually aggressive tactics to force migrant removals.

To get more detention beds, the Trump administration has modified dozens of existing agreements with contractors and used no-bid contracts. One pays $73 million to a company led by former federal immigration officials for “immigration enforcement support teams” to handle administrative tasks, such as helping coordinate removals, triaging complaints or telling ICE if someone is a risk to community safety.

Just last week , Geo Group announced that ICE modified a contract for an existing detention center in southeastern Georgia so that the company could reopen an idle prison on adjacent land to hold 1,868 migrants — and earn $66 million in annual revenue.

“Never in our 42-year company history have we had so much activity and demand for our services as we are seeing right now,” said CoreCivic CEO Damon Hininger during an earnings call last month with shareholders.

A tax-cutting and budget reconciliation measure approved last month by the House includes $45 billion over four years for immigrant detention, a threefold spending increase. The Senate is now considering that legislation.

When Trump started his second term in January, CoreCivic and Geo had around 20 idle facilities, partly because of sentencing reforms that reduced prison populations. But the Trump administration wants to more than double the existing 41,000 beds for detaining migrants to at least 100,000 beds and — if private prison executives’ predictions are accurate — possibly to more than 150,000.

ICE declared a national emergency on the U.S. border with Mexico as part of its justification for authorizing nine five-year contracts for a combined 10,312 beds without “Full and Open Competition.”