A federal immigration judge announced Thursday that Josemaria Islas, a local undocumented Mexican immigrant whose detention incited widespread controversy, will be released from the custody of Immigration and Customs Enforcement (ICE) after posting bond.

Islas, who was arrested by Hamden police in July, was detained at a Massachusetts jail earlier this month in voluntary compliance with an ICE hold request authorized under the federal Secure Communities program. Islas’ case sparked an outcry among immigrants’ rights groups and politicians including Gov. Dannel Malloy and Mayor John DeStefano Jr., all of whom decried the detention as an example of overly aggressive ICE policy. But on Thursday, a Hartford immigration judge announced Islas’ release on $4,000 bond, leading to celebration among a crowd of 35 supporters gathered outside the courthouse.

“Josemaria’s case is unfortunately just one of too many cases where individuals with little to no criminal history are subject to deportation,” DeStefano said in an email to the News, calling Secure Communities “counterproductive” to the relationships the police department has attempted to establish in immigrant communities.

ICE spokesman Ross Feinstein, however, countered that Islas has exhibited grounds for becoming “a priority for removal” as an undocumented immigrant who has repeatedly violated immigration law. He said Islas was been deported on four separate occasions in 2005, entering again without permission.

At the time of his arrest, Islas was charged with a misdemeanor of attempted armed robbery after the robbery victim identified him as the offender. But Islas was not convicted of any crime due to lack of evidence.

“Our priorities in New Haven, Conn., are the same as our priorities nationwide, which target illegal aliens based on our stated immigration enforcement priorities,” Feinstein said. “ICE has adopted clear priorities that call for the agency’s enforcement resources to be focused on the identification and removal of those that have broken criminal laws, recently crossed our border, repeatedly violated immigration law or are fugitives from immigration court.”

Secure Communities, which was implemented statewide Feb. 22, allows ICE officials to check police fingerprints of criminal suspects against ICE and FBI databases in an effort to deport criminals residing in the country illegally. When ICE officials believe a suspect may be undocumented, they can issue a detainment request asking the state to hold the individual in custody pending deportation proceedings. Such hold requests are not legally compulsory, and Gov. Dannel Malloy, a strong critic of the program, has repeatedly promised since March not to comply with those for non-violent offenders. Nevertheless, the program has garnered criticism for unnecessarily targeting nonviolent criminals and undermining community policing.

But while Islas is a nonviolent offender, Malloy cannot overturn the judicial branch’s decision to place him in ICE’s custody, as the state judiciary has a tradition of complying with all hold requests without discretion. But Judge Patrick Carroll, Connecticut’s deputy chief court administrator, announced in a Thursday release that the policy is under review. He said state judicial officials are working with members of the executive branch to “develop a uniform policy” to honor Secure Communities detainment requests for only violent offenders.

In an effort to put additional pressure on the judicial branch to amend its policies in a timely manner, Mike Lawlor, a top aide for Malloy, joined forces with local advocacy groups to denounce the Secure Communities program at Thursday’s press conference. Latrina Kelly-James of Junta for Progressive Action, a New Haven immigrant rights advocacy group, applauded Lawlor for his “continued support of immigration policy change” and said they  are “unified as advocates.”

“Secure Communities puts state and local government in the middle of a no-win situation,” Lawlor said. “It couldn’t be any clearer that there is so much wrong with current immigration laws.”

Ana Maria Rivera of Junta for Progressive Action  said she hopes that increased cooperation among branches of state government and the community will ensure that Islas’ incarceration marks the “last case of wrongful detainment we will see in Connecticut.”

Lawlor said the state cannot afford “the breakdown of trust” in immigrant communities if state and federal authorities are overly aggressive in targeting undocumented aliens for deportation.

Junta for Progressive Action estimates that approximately 10,000 to 15,000 undocumented Latino immigrants reside in New Haven.