A judge reportedly allowed an immigrant who was in court on drugs charges to leave through the back door to avoid immigration enforcement officers who had arrived to arrest him.

Shelley Joseph, a judge in the suburbs of Boston, is reportedly being investigated by a federal grand jury over claims she helped the man – Jose Medina-Perez – escape arrest by Immigration and Customs Enforcement (ICE) staff.

The incident is said to have happened in April, when Mr Medina-Perez was appearing before Judge Joseph’s court after being arrested on drug charges. Mr Medina-Perez was ordered to reappear before the court on the drugs charges in May, and then allowed to leave.

The Boston Globe said the Dominican defendant had already been deported from the United States twice before.

In the audio recording of the courtroom, Judge Joseph can be heard saying ICE “is going to get him” and “I’m not going to allow them to come in here” before telling a clerk to turn off the recording.

There is then a 58-second gap before the recording begins again. The newspaper quotes two anonymous sources who claim Mr Medina-Perez was then released from custody and let out of the back door of the courthouse.

He scaled a fence and ran away as ICE agents, who had arrived at the Newton District Court to detain him, chased after him, according to the newspaper.

Judge Joseph declined to comment when contacted by US media but now the governor of Massachusetts, Charlie Baker, has called for her to stand down from cases while the issue is investigated.

Mr Baker, who appointed Judge Joseph last year, said the allegations against her were “very troubling”.

Shepard Smith on immigration: 'There is no invasion. No one is coming to get you. There is nothing at all to worry about.'

“Look, judges are not supposed to be in the business of obstructing justice,” he told the Boston Globe. “I don’t believe she should be hearing criminal cases until that federal case is resolved.”

Massachusetts court rules state judges and staff should neither assist nor obstruct ICE agents.

The case has highlighted a growing divide over how liberal-leaning Americans should respond to the Trump administration’s increasingly tough immigration policies.

Some cities and states have passed laws forbidding police or officials from helping federal immigration authorities enforce the law, declaring themselves “sanctuary cities”.

‘Families belong together’ protests over Trump immigration policy Show all 8 1 /8 ‘Families belong together’ protests over Trump immigration policy ‘Families belong together’ protests over Trump immigration policy Mishawaka, Indiana AP ‘Families belong together’ protests over Trump immigration policy Washington DC AFP/Getty Images ‘Families belong together’ protests over Trump immigration policy New York Mayor Bill De Blasio speaks in Tornillo, Texas alongside the many other US mayors who have called for detained immigrant children to be reunited with their families AP ‘Families belong together’ protests over Trump immigration policy Albuquerque Mayor Tim Kelle leaves a teddy bear as a gift for detained immigrant children in Tornillo, Texas AP ‘Families belong together’ protests over Trump immigration policy Seattle Mayor Jenny Durkan and Los Angeles Mayor Eric Garcetti leave sandals as gifts for detained immigrant children in Tornillo, Texas AP ‘Families belong together’ protests over Trump immigration policy San Diego, California EPA ‘Families belong together’ protests over Trump immigration policy US embassy, Mexico City AFP/Getty Images ‘Families belong together’ protests over Trump immigration policy San Diego, California EPA

The Massachusetts Association of Criminal Defence Lawyers has announced its backing for Judge Joseph.

In a statement, the organisation said ICE had long “disrupted the proper administration of justice in our state courts, and has undermined the rights of defendants and victims of crime”.

The state’s attorney general, Maura Healey, should file a lawsuit to bar ICE agents from making arrests outside state courthouses, it added.

But a spokesman for ICE, John Mohan, said sending agents to arrest people at court was necessary, because local agencies refused to cooperate.

Support free-thinking journalism and attend Independent events

“ICE officers take their responsibility for enforcement of this nation’s immigration laws very seriously, and are committed to ensuring public safety,” he said.

Others in Massachusetts accused Judge Joseph of undermining the rule of law. One Republican county sheriff, Thomas Hodgson, said her actions were “completely outrageous”.

“I don’t know how you can send a message to the public that you’re there to protect people from criminals, and then undermine law enforcement by letting them out the door,” he said.