Kamyar Samimi, a green-card holder with 40 years in the United States, died 13 days after ICE agents took him into custody. When he arrived at a private prison in suburban Denver, he told prison officials that his doctor had prescribed medicine to control an addiction. The prison’s doctor never bothered to see him. Soon his health tumbled; nurses gave him half the medicine that the prison doctor ordered. Nurses said he was faking, hoping to get drugs, an internal review released a year later revealed. Finally, after he had become too ill to be moved into a wheelchair, as he vomited and urinated on himself, prison guards called for an ambulance. Emergency responders arrived four minutes later, but Mr. Samimi stopped breathing before they could get him into the ambulance. His death was tragic, but not isolated. Since Oct. 1 , two of ICE’s detainees have died.

The United States should shut down its immigration prison system. The federal government should redirect the billions of dollars it spends jailing migrants — $2.7 billion alone in 2017 for ICE’s detention system — to helping them navigate the labyrinthine legal process. To navigate high-stakes immigration court cases, migrants need lawyers, social workers and case managers. Right now, most get none of those. In immigration court, there is no government-paid lawyer, and most detained migrants can’t afford to hire one. But going back to the Reagan administration, pilot projects that offer support consistently display remarkable success getting migrants to show up for court dates and stay out of trouble.

In an immigration court system that handles 200,000 cases a year, there are bound to be some people who flout the rules. And there will be others who get their day in court only to lose. When that happens, two options are available. We could arrest and deport those people, or we could turn the other way.

For decades, the bipartisan consensus has been to rely on arrest and deportation. But what if we asked this instead: What good comes from locking up migrants? Republicans declare that we need to detain migrants to uphold the rule of law. Democrats add that detention helps keep our communities safe. Neither of these claims stands up to scrutiny.

The rule of law isn’t a blunt hammer. Prosecutors regularly choose whether to go after \citizens who have committed crimes. Even when evidence of guilt is strong, there might be other reasons to let illegal activity slide: Perhaps a first-time offender deserves a second chance or putting a parent in jail would do more harm than good. Whatever the reason, the Supreme Court declared in 1985, prosecutors have “broad discretion as to whom to prosecute”— or in not prosecuting. It’s up to prosecutors to weigh the harm that prosecution seeks to remedy. When it comes to immigration law violations, locking up migrants is applying brute force to a minor transgression.