Ismael should have been happy.

After eight years in deportation proceedings, he learned last year that the government had decided to terminate the case using prosecutorial discretion. Ismael had entered the United States from Mexico without legal permission in 1998 and resided in St. Paul for more than two decades, working, paying taxes and fathering two American citizen children.

His relief gave way to worry. Due to a quirk in the immigration system, the government had granted him a work permit while he fought his deportation case — but Ismael, 45, was no longer eligible for one now that authorities said he could stay.

The government's message: You can live here, but you can't work here.

Ismael's conundrum will likely start affecting many more immigrants after the U.S. Supreme Court ruled 8 to 1 to uphold prosecutorial discretion in June. The ruling allows Immigration Customs and Enforcement (ICE) to close cases against undocumented residents whom they decide are a low priority to deport. The Department of Homeland Security wants prosecutors to drop such cases in favor of the most serious ones to help ease the overwhelmed immigration courts, where a record 2.6 million cases are pending nationwide.

"There's going to be lots and lots of people who are going to get discretion and will not get a work permit card just like Ismael," said Ismael's attorney, Alyssa Nguyen-Schmitz.

After graduating high school 45 minutes outside Mexico City, Ismael decided he would join neighbors who had migrated to Minnesota. He wanted to support his impoverished family.

"My main [reason] for coming here was to get a better life for them and for me too, even if I knew I was going to make a big sacrifice," recalled Ismael, who asked that his last name not be published due to his immigration status.

The day he left, Ismael saw his father cry for the first time and his mother worried she would never see her son again.

Immigration authorities caught Ismael the first time he crossed the U.S. border and sent him back. He made it the second time undetected. After a year in California, he joined his friends in St. Paul and started earning a living as a restaurant dishwasher. He sent money home, eventually paying to build his family a house. He found better jobs as a forklift operator and warehouse assembler and learned English.

In 2014, Ismael pleaded guilty to disorderly conduct, a misdemeanor that was later dismissed. Police learned he was undocumented, and ICE opened a deportation case. Ismael's immigration attorney filed an application for cancellation of removal on his behalf, and Ismael discovered a strangely positive side of the ordeal: He was finally eligible for a work permit.

"It was life changing," Ismael said.

Now he could land better positions with health insurance. Employers paid more and were less able to take advantage of him.

But getting a cancellation of removal required him to demonstrate that he had a family member who is an American citizen or lawful permanent resident who would suffer exceptional and extremely unusual hardship if he was deported. His attorney tried to make the case by showing how Ismael's American-born son, now 11, had learning disabilities, but the child's health improved as the years went by and their arguments weakened. As part of his case, Ismael also filed extensive documentation of his work history and taxes paid, along with letters testifying to his "good moral character."

Winning such cases is hard, and Ismael's chances of staying in the U.S. seemed unlikely until Homeland Security Secretary Alejandro Mayorkas issued a memo in late 2021 instructing immigration authorities to prioritize limited resources by focusing on deporting people who are a threat to national security, border security and public safety.

Prosecutorial discretion had been used for a long time, though it was curtailed under ex-President Donald Trump. But Mayorkas advised prosecutors to use discretion in proceedings involving longtime immigrants who were a low priority and either dismiss their cases or administratively close them by temporarily pausing the proceedings and removing them from the courts' active calendars.

Nguyen-Schmitz warned Ismael that if the case was dismissed he would lose his work permit, and urged him to talk about it with his common-law wife. (Immigrants with cases closed administratively can still obtain a work authorization.) By then he had another son, now 3. He and his wife had bought a house in east St. Paul. Ismael saw his 11-year-old on the verge of tears when he talked about the possibility of leaving.

"I remember Ismael and I were very torn about this," Nguyen-Schmitz recalled.

The most important thing, Ismael concluded, was staying here. The government dismissed his case and Immigration Judge Katherine Hansen approved it in July 2022.

The policy was only in effect for a few months when Texas and Louisiana sued, saying President Joe Biden's administration was not meeting its mandate to arrest and detain certain noncitizens and that states would bear the extra costs of health care, education and law enforcement for this undocumented population. The case made it to the Supreme Court, which upheld prosecutorial discretion on June 23, concluding that states lack authority to challenge the executive branch's enforcement priorities.

American Immigration Lawyers Association (AILA) policy and practice counsel ManoLasya Perepa said she's found through members and advocates that the government's general policy is offering to dismiss cases instead of administratively close them.

"Even if they don't believe this person is dangerous, not a security threat, doesn't need to be removed from the United States, somehow all of this is not enough for this person to be able to work legally. ... Its just like, 'Great, you've taken me out of removal proceedings, but it's kind of worthless,'" Perepa said.

Robyn Meyer-Thompson, supervising attorney at the Immigrant Law Center of Minnesota, said she has a number of clients who are evaluating whether prosecutorial discretion is the best remedy in their cases "and their eligibility for working is a big consideration."

Immigrants can obtain work permits if they win their cancellation of removal applications and don't rely on prosecutorial discretion. But even then, they wait three to five years for a green card because of annual caps on how many judges can grant, and a large backlog. Even in this best-case scenario, Meyer-Thompson noted, "they're still in purgatory for a while."

Ismael loves Minnesota, especially ambling through the neighborhood with his two Great Pyrenees dogs. But sometimes, he feels invisible because of his immigration status.

He is now in a limbo of sorts, without legal immigration status and no path to citizenship. Ismael has no permission to leave the country and return, and hasn't seen his parents since he left at age 18. He missed his father's death three years ago. The dozen friends he grew up with in Mexico are still here, surviving in the shadows without papers. His wife is also a Mexican native who receives deportation protections and work-permit eligibility under Deferred Action for Childhood Arrivals — another program that has faced court challenges.

"This is always a question in our mind: What's going to happen?" Ismael said.