This week a federal judge ordered a bond hearing for a woman who has been detained without due process by U.S. Immigration and Customs Enforcement (ICE) for nearly a year and a half. Bertha Mejia, a grandmother with deep family ties in California and with no violent criminal history, was classified by ICE as a “mandatory detainee” because of misdemeanor convictions for stealing groceries. That classification made her ineligible for a hearing before an immigration judge where she could present evidence that she posed no danger to the community or risk of flight—even as her immigration case dragged on for months with no end in sight.

The victory is the result of a petition the ACLU of Northern California and Ms. Mejia’s immigration attorney, Rosy Cho, filed in federal court in early February. The ruling recognizes that Ms. Mejia never should have been in mandatory lock-up in the first place, and should have received a prompt bond hearing to determine if she needed to be detained.

Enacted in 1996, the federal mandatory detention statute was intended to apply only to immigrants transferred directly from criminal custody to immigration custody for deportation proceedings—and not individuals living in the community, without incident, for months or years after their release.

Ms. Mejia was abruptly detained by ICE officers at her home nearly a year after a misdemeanor shoplifting offense. But as the district court held, Congress did not intend to strip immigrants of their due process rights based on old convictions—including for minor, nonviolent offenses like petty theft.

Because of ICE’s unlawful policies, Ms. Mejia has languished in a county jail for the past year and a half. Her lengthy detention has also caused great hardship for her loved ones, especially for her 9-year-old grandson she was raising. Meanwhile, taxpayers funded Ms. Mejia’s unnecessary detention at the rate of $164 per day, to a total cost of nearly $90,000.

Unfortunately, Ms. Mejia’s case is just the tip of the iceberg. ICE routinely subjects immigrants nationwide to unlawful mandatory detention. Ms. Mejia is but another example of ICE’s senseless incarceration of individuals who pose no flight risk or danger. And American taxpayers foot the bill. Effective alternatives to detention—such as ankle monitors, curfews, and reporting requirements—are available at a fraction of the cost of detention. As Congress holds oversight hearings on our immigration system in the upcoming weeks, it should remember cases like Ms. Mejia’s and take steps to curtail wasteful immigration detention.

Update: Bertha Mejia’s victory was covered further on Univisión’s national newscast.

Learn more about immigration detention and other civil liberty issues: Sign up for breaking news alerts, follow us on Twitter, and like us on Facebook.