Getting married used to prevent deportation. Not anymore.

As the Trump administration arrests thousands of immigrants with no criminal history and reshapes the prospects of even legal immigrants — an overdue corrective, officials say, to the lenient policies of the past — many who have lived without papers for years are urgently seeking legal status by way of a parent, adult child or spouse who is already a citizen or permanent resident.

In a growing number of cases, however, immigrants with old deportation orders that were never enforced are getting the go-ahead after an interview by United States Citizenship and Immigration Services, the agency that handles residency and citizenship, only to be arrested by ICE.

“It’s like playing dice in Las Vegas or something,” said William Joyce, a former immigration judge who now practices immigration law in Boston. “It’s not 100 percent, but you’re playing with fire if you go to that interview. You can walk in, but you won’t be walking out.”