Immigration agents arrested Pablo Villavicencio, 35, at the Fort Hamilton military base in Brooklyn, New York on Friday where he had gone to make a delivery.
He had been to the base several times before, presenting his New York city ID card that carries no mention of his immigration status.
But on June 1 he was he was asked by a military policeman for proof that he was a legal resident of the United States.
When he failed to produce the required documents, the soldier detained him and called Immigration and Customs Enforcement (ICE), which established that the father of two girls, aged two and three, had been living illegally in the country since 2010.
Though Villavicencio was supposed to have left the United States, he stayed to work, making him eligible to be deported.
Manhattan judge Alison Nathan on Saturday placed his deportation order on hold until another court hearing scheduled for July 20, and he remains in custody.
Immigration agents have also started making arrests even in courts which previously held "sanctuary" status.
New York Governor Andrew Cuomo on Friday said it appeared that the delivery man was a victim of ethnic profiling.
US media report that his wife is a US citizen and he has now filed an application for residency.
(This story has not been edited by NDTV staff and is auto-generated from a syndicated feed.)
Get the latest election news, live updates and election schedule for Lok Sabha Elections 2019 on ndtv.com/elections. Like us on Facebook or follow us on Twitter and Instagram for updates from each of the 543 parliamentary seats for the 2019 Indian general elections.