Federal authorities have brought criminal charges against District Court Judge Shelley Joseph, who was placed under investigation last year after allegedly helping a defendant in her courtroom avoid waiting immigration authorities.

Joseph faced scrutiny for her handling of the case of Jose Medina-Perez, who was facing deportation following recent drug charges in Newton and an outstanding warrant for drunk driving in Pennsylvania.

According to federal prosecutors, ICE issued an immigration detainer against Medina-Perez, who had previously been deported, following his arrest by Newton Police in March of 2018.

A plainclothes ICE agent showed up at Newton District Court for Medina-Perez’ arraignment, intending to take him into custody. But federal prosecutors allege that Joseph ordered the agent out of the courtroom and ordered the courtroom recorder turned off as she discussed Medina-Perez’ ICE detainer with his defense attorney and an Assistant District Attorney.

“ICE is gonna get him?” Joseph said, according to a transcript of the recorded portion of the conversation.

Joseph then ordered Medina-Perez released without bail and instructed Trial Court Officer Wesley MacGregor to accompany him to the downstairs lockup, while barring the ICE agent from entering the courtroom, according to prosecutors. MacGregor then allegedly allowed Medina-Perez to exit through a back door.

The Boston Globe reported reported in December of 2018 that U.S. Attorney Andrew Lelling had convened a federal grand jury on the matter.

Both Joseph and MacGregor were indicted Thursday on counts of conspiracy to obstruct justice, aiding and abetting obstruction of justice and aiding and abetting obstruction of a federal proceeding.

Prosecutors also alleged MacGregor committed perjury, falsely telling a federal grand jury that he did not know there was an ICE detainer for Medina-Perez at the time.

Joseph was still hearing cases up until this week.

The presence of Immigration and Customs Enforcement agents in courtrooms has long drawn the ire of immigrant advocates, who say the fear of detention can deter immigrants in the country illegally from testifying or showing up to court.

This is a developing story.