NEW YORK (AP) — An Ecuadorean immigrant who was held for deportation after delivering pizza to a Brooklyn Army installation walked out of an immigration detention center house hours after a judge ordered his immediate release.

Pablo Villavicencio exited the detention center shortly before 9 p.m. Tuesday. He was greeted with hugs from his jubilant wife and two young daughters. He thanked supporters and the media before being whisked away in an SUV.

U.S. District Judge Paul Crotty said Villavicencio, who was being held at a New Jersey lockup, can remain in the United States while he exhausts his right to try to gain legal status.

"Although he stayed in the United States unlawfully and is currently subject to a final order of removal, he has otherwise been a model citizen," the judge wrote.

Villavicencio applied to stay in the U.S. after he married a U.S. citizen, with whom he has two young girls.

The judge cited those children and said they are U.S. citizens.

"He has no criminal history," the judge wrote. "He has paid his taxes. And he has worked diligently to provide for his family."

The U.S. government, which had wanted the case moved from New York to New Jersey, did not immediately comment on the judge's action.

An Ecuadorean immigrant who was held for deportation after he delivered pizza to a Brooklyn Army installation has been released. A federal judge ruled that Pablo Villavicencio can remain in the U.S. while he tries to gain legal status. (July 25)

Adriene Holder, the attorney-in-charge of the civil practice at the Legal Aid Society, said the rule of "law, humanity and morality" prevailed and the Villavicencio family has "finally received a crucial measure of relief from their 53-day nightmare."

"This decision should serve as a rebuke against the Trump Administration and its merciless crusade to tear families apart," Holder said in a statement.

The judge ruled after hearing arguments earlier Tuesday, when he put a government lawyer on the spot over the effort by immigration authorities to enforce a 2010 deportation order. He questioned the need to detain and quickly deport Villavicencio, who's 35 years old.

"Well, the powerful are doing what they want, and the poor are suffering what they must," the judge said after hearing Assistant U.S. Attorney Joseph Cordaro defend the government's actions.

"I mean, is there any concept of justice here or are we just doing this because we want to?" the judge asked. "Why do we want to enforce the order? It makes no difference in terms of the larger issues facing the country."

Cordaro argued for the case to be transferred to New Jersey because Villavicencio is detained there. He said legal precedent dictated that New Jersey was the proper venue, an argument the judge rejected.

Cordaro said Villavicencio would still be able to pursue his application to become a legal U.S. resident after he is deported.

The case has attracted widespread attention amid a crackdown by the administration of President Donald Trump on illegal immigration. Trump, a Republican, has said his policies are designed to keep the country safe.

Gov. Andrew Cuomo, a Democrat, said the federal government has "cruelly" kept Villavicencio from his wife, Sandra Chica, and two daughters "for no legitimate reason."

Villavicencio was arrested on June 1 while making a delivery to the garrison in Fort Hamilton. When he arrived at Fort Hamilton, guards requested identification, and he produced a city identification card. A background check showed he had been ordered to leave the United States in 2010 but stayed.

Villavicencio's two girls, ages 2 and 4, played with toys on Tuesday as courtroom spectators around them observed the legal arguments. Villavicencio was not in court.

Another judge had already temporarily blocked his deportation.

___

Associated Press writer Claudia Torrens contributed to this report.