A Massachusetts judge and court officer were charged with federal obstruction of justice by the Boston U.S. Attorney's Office for helping an undocumented immigrant elude arrest in April 2018, according to an indictment unsealed on Thursday.

Details Judge Shelley Joseph and court officer Wesley MacGregor allegedly devised a plan after the prosecutor and the suspect's defense attorney said they thought U.S. Immigration and Customs Enforcement targeted the wrong person. The government alleges that MacGregor used his security access card to release the suspect out of the back exit of the courthouse.

It is unclear what happened to the defendant — identified as A.S. — after he left the courthouse. Joseph is expected in court Thursday afternoon.

The big picture: In 2017, Boston was one of 5 jurisdictions in Massachusetts that ICE deemed "non-cooperative," or a "sanctuary city." President Trump recently said his administration is strongly considering placing "illegal immigrants" in sanctuary cities, an extreme proposal that critics view as political retribution.

Go deeper: "Sanctuary city" mayors welcome Trump's latest immigration idea