CONCORD — A Cuban immigrant living in Barrington was released from federal custody Tuesday, nearly 24 hours after the American Civil Liberties Union of New Hampshire filed an emergency lawsuit demanding his immediate release.

ACLU officials announced the filing of the lawsuit Monday after learning that Victor Gonzalez-Triana had been granted permanent residency Jan. 2, had had his deportation proceedings dropped Jan. 10 by an immigration judge, and had received his green card in the mail Monday, yet was still being held in an Immigration and Customs Enforcement facility in Massachusetts as of that night, ACLU officials said in a release.

“Last night while I ate dinner with my family, our client remained unlawfully in jail — despite being a permanent resident of the United States,” said Gilles Bissonnette, legal director of the ACLU of New Hampshire, in a statement. “It is incomprehensible that ICE would continue to hold a person for even a few hours knowing that they have a right to be released. Now that he has been freed, our client can reunite with his family and get back to his life.”

“Cases like this are exactly why we formed the New Hampshire Immigrants’ Rights Project: so that we can immediately act when something is unconstitutional, unlawful, or unconscionable within our immigration system,” said Devon Chaffee, executive director of the ACLU of New Hampshire, in a statement. “We are pleased that Mr. Gonzalez-Triana has been released from custody after far too long, and is now reunited with his loved ones.”

According to a release, Gonzalez-Triana came to the U.S. in 1994 from Cuba. The ACLU-NH said he operates a business and pays taxes in New Hampshire, but was detained by ICE in September 2018 for falling out of immigration status. While detained he applied and approved for permanent residency.