(CBSDFW.COM/AP) – A federal judge has ordered the release of an Ecuadorean immigrant who was held for deportation after he delivered pizza to a Brooklyn Army installation.

Judge Paul Crotty issued an order late Tuesday saying Pablo Villavicencio must be immediately released. The man is being held at a New Jersey lockup.

READ MORE: Accused Cop Killer Oscar Rosales Caught At Texas-Mexico Border

Pablo Villavicencio and his two daughters. (Facebook)

The judge says the release is necessary because his imminent removal from the United States is no longer reasonably foreseeable.

Villavicencio was arrested on June 1 when he tried to make a delivery to the Fort Hamilton garrison in Brooklyn. He was arrested after a routine background check at the base revealed he had a warrant for immigration law violations.

He was granted an emergency stay on June 9 until his case went to court.

READ MORE: Texas Woman Who Allegedly Attempted To Buy A Baby At Walmart Arrested

The judge says Villavicencio can remain in the United States while he exhausts his right to complete an effort to gain legal status. Villavicencio applied to stay in the U.S. after he married a U.S. citizen. They have two young girls.

When he was arrested, his wife, Sandra Chica, pleaded with authorities, “Please ICE, do the right thing with my husband.”

“He is trying to stay here the legal way. Please don’t stop him, don’t take him away from us,” said Chica.

Crotty ruled after hearing arguments earlier Tuesday.

Assistant U.S. Attorney Joseph Cordaro argued for the case to be transferred to New Jersey.

MORE NEWS: Oakridge High School Teacher Bonnie Guess Mazock Arrested, Charged For Alleged Inappropriate Relationship With Student

(© Copyright 2018 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)