Officials with the U.S. Immigration and Customs Enforcement (ICE) agency arrested an illegal alien, a registered sex offender, on Monday. Orange County, North Carolina, authorities had released him from custody in June without telling ICE.

ICE officials arrested Mexican national Udiel Aguilar-Castellanos, 42, on Monday at his residence in Carrboro one month after Orange County officials released him from prison, ICE officials announced Wednesday.

Aguilar-Castellanos agreed to plead guilty to two counts of sexual battery on June 27 for sexually abusing an 11-year-old girl. He had to register as a sex offender as part of his plea deal to avoid prison.

The Mexican national had also been convicted of driving while intoxicated in 2014 and avoided deportation for more than three years—even though an immigration judge gave him a final order of removal in 2015.

But Orange County officials offered him the plea deal and his release from jail in June without honoring ICE’s request from September 2017 to detain the suspect for being in the country illegally.

“When law enforcement agencies fail to honor immigration detainers and release serious criminal offenders onto the streets it undermines ICE’s ability to protect public safety,” said ICE’s Enforcement and Removal Operations (ERO) Atlanta Field Office director, Sean Gallagher.

The Mexican national was able to evade immigration authorities following his release from jail largely because county officials did not give ICE updates on his whereabouts. But Aguilar-Castellanos’s days of evading ICE came to an end on July 11, when he registered as a sex offender in North Carolina.

ICE officials then opened up an investigation into the illegal alien’s whereabouts, which led to his arrest Monday. Aguilar-Castellanos is currently in ICE custody awaiting deportation from the U.S.

Even though North Carolina state lawmakers have banned sanctuary cities, Orange County officials have enacted sanctuary policies to prevent local law enforcement from fully cooperating with ICE. In 2017, Orange County Sheriff Charles Blackwood and Carrboro Police Chief Walter Horton said that immigration enforcement is not a priority for local law enforcement.

Blackwood said in a separate interview in April that the Orange County Sheriff’s Office does not honor ICE detainers—which requests that local law enforcement detain people suspected of being in the U.S. illegally for 48 hours until ICE takes them into custody—because they are requests and not signed by a judge.