On the eve of the Iowa Caucuses in January 2016, when Donald Trump’s presidential campaign still seemed a long-shot, he landed a crucial endorsement. Joe Arpaio, the Phoenix-area sheriff hailed by conservative activists for being tough on immigration, embraced Trump with a prescient message. “Everything I believe in,” Arpaio declared, “he’s going to do when he becomes president.”

The former sheriff rose to national prominence by running an outdoor jail in the desert he once proudly referred to as a “concentration camp.” Arpaio, who is now running for the United States Senate, sees no reason to reconsider the remark. “I’m not going to back down,” Arpaio said in a recent interview. “So what? Maybe it is a concentration camp. I don’t want to make it look nice, like the Hilton Hotel. I want to say it’s a tough place so people don’t want to come there.”

Now Trump, his most prominent champion, is working to execute an Arpaio-style immigration crackdown at a scale neither may have imagined in Iowa. America’s immigrant detention centers have proliferated in recent decades as a result of bipartisan investment. But the Trump administration is aggressively expanding these facilities, where conditions often seem punitively harsh, locking up many immigrants who pose no obvious threat to public safety. A year into President Trump’s crackdown, tens of thousands of immigrants are living the consequences, and fighting against deportation from behind bars.

“Fate,” Arpaio told me, binds him to Trump. They share a gut-level instinct for law-and-order politics, if not for the rule of law itself, and an ability to parlay the resentments of white voters into electoral success. Last summer, Arpaio, the famous jailer, faced incarceration himself. A federal judge convicted him of criminal contempt of court for his “flagrant disregard” of an order to stop detaining people solely on suspicion of their being in the country illegally. As Hurricane Harvey bore down on southeast Texas, Trump found time to pardon Arpaio.

In recent interviews, immigration restrictionists, immigrant advocates, and former Immigration and Customs Enforcement officials found a point of common agreement. For better or worse, they said, pardoning Arpaio sent a clear message to immigration agents: take the gloves off.

“Pardoning Joe Arpaio sends a very clear message to ICE agents,” said Kevin Landy, a former assistant director at ICE. Agents now understand they need not be “overly concerned about individuals’ due process rights,” Landy lamented. The pardon is a “green light” for racial profiling, worried Carlos Garcia of the Phoenix-based advocacy group Puente. Jessica Vaughan, an analyst at the Center for Immigration Studies, which supports restrictive immigration policy, approved of the pardon because it telegraphs “no apologies for increasing immigration enforcement,” even if it is “politically incorrect.”

Arpaio lost reelection in 2016, and the new Maricopa County Sheriff promptly shut down his notorious jail. But with Arpaio’s brand of toughness now embodied in Trump’s crackdown on immigrants, his legacy extends far beyond the rows of surplus tents left over from the Korean War. Arpaio said that Trump removed the “handcuffs” from immigration agents. At last, he said, “they can enforce the illegal immigration laws.”

The United States has built an archipelago of more than 200 immigration-detention centers, sprinkled throughout the country. ICE keeps immigrants in detention when the agency determines they are a flight risk or a threat to public safety. Most are held for days or weeks en route to deportation, but thousands are confined for years while they fight their removal. Detainees are not serving a criminal sentence, but the conditions in detention are often indistinguishable from those of a prison.

“Under the Trump administration, we’re seeing the detention system balloon,” said Clara Long, a senior researcher at Human Rights Watch. With arrests up by 30 percent, ICE has requested $2.7 billion to increase detention capacity by 25 percent. “It is one of the fastest growing sectors of the carceral state,” said Kelly Lytle Hernandez, an immigration historian at UCLA.

Detention is big business. ICE relies on private prison companies for roughly 70 percent of its long-term lockups. After the election, the stock prices of  the two largest private prison companies, Geo Group and CoreCivic, nearly doubled.

ICE agents are optimistic about the expansion, said Henry Lucero, who oversees ICE operations in Arizona. “Now if we encounter you, there is a very great chance you’re going to be arrested,” he said. While the Obama administration tried to limit deportations to those with criminal records, Trump effectively made every undocumented immigrant a potential target. “The handcuffs are taken off of our individual officers,” said Lucero, echoing Arpaio. Non-criminal arrests more than doubled last fiscal year to  37,734, according to ICE.

But most of the growth in detention predates Trump. After decades of bipartisan collaboration, Trump “inherited a machine,” said Long. In 1995, Bill Clinton advertised that he was “deporting twice as many criminal aliens as ever before.” The next year, Congress passed two laws, the Illegal Immigration Reform and Immigrant Responsibility Act, and the Antiterrorism and Effective Death Penalty Act, which together expanded categories of deportable immigrants and mandated more detention. The Bush and Obama administrations followed suit. In 1994, there were roughly 5,000 detainees a day. In 2018, ICE has requested enough money to maintain a daily population of 51,000.

Inside a cell for mothers and daughters at an ICE office in Phoenix. ICE arrests of non-criminals more than doubled last year. Jeremy Raff / The Atlantic

Some former ICE officials have raised concerns about the collateral damage of unabated growth. Detaining so many immigrants “weighed heavy on me when I was director,” said John Sandweg, acting head of ICE during the Obama administration, because “the life and safety of these people is in our hands.”

The problem with detention, Sandweg argued, is that even the best-run operations have inherent risks: infectious disease outbreaks, sexual assault, pre-existing medical conditions, asylum seekers who may be traumatized and suicidal. That’s why detention, Sandweg said, should be reserved for what he estimated are the 5,000 true “public-safety threats.” For “your run-of-the mill undocumented immigrant,” however, Sandweg prefers “safer, more humane ways of doing this that are no less tough,” like ankle-monitoring technology and supervised-release programs.

But “the public likes to hear ‘detention,’ It sounds tough,” said Sandweg. “It’s billions of dollars for a talking point.”

One Arizona woman agreed to tell me about her experience in detention. In 2015, she was visiting the state from Bolivia when her host attempted to coerce her into a kind of indentured servitude. “I was desperate,” she said, so she fled to a Border Patrol station to file a report against the person and to ask for help. “But they didn’t believe me.” Instead, officials detained her because they suspected she had used her tourist visa to work illegally. (I was introduced to the woman by the Florence Project, a local group that provides aid to detained immigrants; she spoke on condition of anonymity, out of fear of retaliation against her family by her alleged abuser.)

After several days in a holding cell, which she called a “hielera,” or freezer, she was transferred to the 1,500-bed Eloy Detention Center, which sits in a desolate stretch of desert about two hours from the border. “When I arrived, they took away my name and gave me a number: 318.”

Of 179 deaths in ICE detention since 2003, 15 happened at Eloy Detention Center in Arizona, more than any other in the country. Jeremy Raff / The Atlantic

It was 20 days before she was able to call her family and tell them where she was. “I had to endure many humiliations in detention,” she said. Detainees who cried were sent to “the hole,” or solitary confinement, she said. Ironically, though she had been detained on the suspicion of working illegally, she now labored in the kitchen at Eloy for meager pay, starting each day at 2 a.m. (Last year, ICE contractors in Washington and California were sued for paying $1 and $1.50 a day respectively.)

Psychologically, one of the most pernicious aspects of detention is that unlike serving a criminal sentence, detainees don’t know how long they will behind bars. Their cases slowly wind their way through an immigration-court system backlogged with more than 667,000 cases.

She took a bible study course by mail to stay “strong,” but saw other detainees “try to hurt themselves.”

After a fellow detainee committed suicide by stuffing a sock down his throat, the woman said, “they gave us shorter socks.” Jeremy Raff / The Atlantic

“Eloy is one of the deadliest detention centers in the country,” said Carlos Garcia of Puente. Since ICE was founded in 2003, 179 detainees have died in its custody--15 at Eloy alone. Reports from Human Rights First, Human Rights Watch, Detention Watch Network and the Inter-American Commission on Human Rights allege subpar conditions and preventable deaths in lockups across the country. But “Eloy stands out for the large number of deaths,” said Long, and “for the large number of suicides.” While the woman was detained there, two people died. One, José de Jesús Deniz Sahagun, generated considerable media attention because of the unusual circumstances of his death. He committed suicide by stuffing a sock down his throat.

“After that, they gave us shorter socks,” the woman recalled.

She sought a protective visa from inside detention. She thought it might take a month, but in the end she spent “two years and one month” behind bars. “The worst thing I carry,” she said, is missing birthdays and holidays with her daughters. “They needed me during that time, when they were younger.”

Finally, the government granted her a visa for victims of human trafficking. She now sells food from her modest apartment in Tucson to get by.

“I’m starting from zero,” she said.

After losing reelection as sheriff, Joe Arpaio, at 85 years of age, is looking for new opportunities.

The shifting middle of the Republican Party may present an opening. As my colleague Peter Beinart writes, “Trump has succeeded in erasing the ‘legal good, illegal bad’ distinction that for years governed GOP immigration debate.”

At a recent campaign-style speech Arpaio gave in Fresno, California, a nurse named Janice Winjum expressed some ambivalence about the convicted lawbreaker’s fixation on illegal immigration. She said Arpaio “should pay for that crime and not be pardoned or let go,” but was also eager to hear his version of events. “When they can’t get you on one thing, they always call you a racist,” Arpaio said. The crowd applauded.

Winjum works at a hospital in Fresno, which is almost 50 percent Latino. She said many of her patients “don’t speak the language,” and suspects “a lot are illegal.” Those patients should be deported, she said, because “we’re a nation of laws, that’s what our country is about.” She concluded that Arpaio, despite his criminal conviction, was “a strong sheriff,” who “stuck to his values.”

Janice Winjum, a nurse, suspects many of her patients “are illegal” and favors their deportation because “we’re a nation of laws.” She supports Arpaio even though he was pardoned for breaking the law.  Jeremy Raff / The Atlantic

A 2016 poll from the Public Religion Research Institute and the Brookings Institution showed that Republican voters were much more likely to support reducing immigration from from Mexico, Central America, and “predominantly Muslim countries” than from “predominantly Christian countries.” Beinart argues that, “what really drives Republican views about immigrants, in other words, is less their legal status than their nation of origin, their religion, and their race.”

That “is a story of race in America that is unbroken from the late 19th century,” said UCLA immigration historian Kelly Lytle Hernandez. When the U.S. annexed the northern half of Mexico in 1848, Hernandez explained, settlers began their westward expansion with the conviction that whites should “dominate land, life and society across the North American continent.” To that end, they lobbied Congress to expel Chinese laborers, the largest non-white immigrant group in the west at the time. The general feeling was, “we did not go to war with Mexico to lay claim to this region so that Chinese immigrants could come and take all the gold out of the land,” Hernandez said.

When Congress “invented this thing called deportation,” Hernandez said, authorities sought to make an example of a cigar maker in Los Angeles named Wong Dep Ken. They detained him at his shop, then “set him off across the sea as the first deportee from California.”

Such deportations met legal challenges, but the Supreme Court soon ruled that the president has almost unrestricted power to expel non-citizens. These decisions placed immigration enforcement outside constitutional protections afforded to people accused of crimes because incarceration for the purpose of deportation is “not imprisonment in a legal sense,” the court ruled in Wong Wing v. United States. Detainees are technically not in prison, and they have no right to a lawyer.

Hernandez pointed out that the court handed down Wong Wing on the same day as Plessy v. Ferguson, the decision that upheld the Jim Crow system. But while Jim Crow was later legally dismantled, immigration enforcement still rests on “the foundation that the U.S. Supreme Court established in the 1890s.”

“U.S. immigration history is not about the nation of immigrants,” Hernandez added, “it's about defining who we are as a country and keeping out people we see as outsiders.”

Last year, illegal border crossings reached their lowest level since 1971. Trump’s tough talk seemed to deter migrants from making the journey, at least for a time. “When people know that they’re not going to be released” from detention, said Vaughan, “it's not an attractive option anymore.”

But Vaughan acknowledges that “officially, detention is not supposed to be used as a deterrent,” because detention and deportation may not be used to punishment immigrants. If they don’t get the same constitutional rights as accused criminals, they shouldn’t get the punishment either, the courts have held. The United Nations also prohibits the use of detention as a deterrent.

Still, the idea of discouraging migration through incarceration has a common-sense appeal, if not a robust body of evidence that it actually works. A 2015 research review by the International Detention Coalition found that lockups are “ineffective” deterrents. The Department of Homeland Security has cited research from Vanderbilt University to show “detention is especially crucial during mass migration.” But the author of that study was so alarmed by the agency’s use of his findings that he wrote in a sworn affidavit: “My Report does not in fact support DHS’ conclusion that detaining these mothers and their children during the course of removal proceedings will deter illegal immigration to the United States.”

Now, the so-called Trump effect seems to be wearing off. Unaccompanied children as well as families seeking protection in the U.S. is again on the rise. In 2017, asylum applications from Central American countries beset by gang violence were up by 25 percent over the previous year.

Immigration lawyer Rocio Castañeda counsels a Guatemalan woman who said her life is in danger. Jeremy Raff / The Atlantic

On a warm fall afternoon, steps from the rusting border fence in Nogales, Mexico, immigration lawyer Rocio Castañeda met a Guatemalan woman who planned to present herself to American border guards to request asylum protection. “If I stayed there, I would be killed,” she said. (She spoke on condition of anonymity, so as not to affect her asylum case.)

In the low-slung cinder block migrant shelter, Castaneda was compassionate but realistic as she discussed the asylum process. Most likely, she told the woman, “you will be sent to a detention center called Eloy,” for at least six months.

Because detention is “not imprisonment in a legal sense,” the woman would have no lawyer to help her navigate the byzantine immigration court bureaucracy, Castaneda explained. The woman kneaded her hands.

Castaneda went on, “I feel that it's my responsibility to share a statistic with you: 90 percent of cases are denied.” The woman nodded.

“So knowing all that, do you still want to turn yourself in?”

“Yes,” she said.

Three months later, she remains in the Eloy Detention Center.