Despite his release, Martinez, who lives in upstate Newburgh, may still be sent back to Mexico.

His deportation trial is set for July 1.

In 2004, he applied for asylum with his wife, Julia Ochoa, who is also undocumented, but they were denied.

Their odyssey with ICE began in 2013 when both were detained. In November, he was told his time was up, and has been fighting his deportation since.

On Wednesday, Martinez's release was hailed by local elected officials and immigration advocates.

"ICE is under an administration that just doesn't care about immigrants and refugees," said Public Advocate Letitia James. "This is an administration that is tearing families apart. Families who have contributed to America, who have children who are American citizens."

City Council Speaker Melissa Mark-Viverito called the Trump administration "racist" while urging ICE to reconsider Martinez's case. "We're going to continue to resist here and everywhere and we can claim victory," she said.