Homeland Security Secretary John F. Kelly talks to the news media as Sen. Gary Peters (D-Mich.) looks on at the Ambassador Bridge border crossing in Detroit last. (Carlos Osorio/AP)

Immigration agents may arrest crime victims and witnesses at courthouses, a homeland security official said Tuesday, highlighting a growing dispute between the Trump administration and some state court officials who fear the practice will hinder law enforcement work in their jurisdictions.

“Just because they’re a victim in a certain case does not mean there’s not something in their background that could cause them to be a removable alien,’’ David Lapan, a Department of Homeland Security spokesman, said in a briefing to reporters. “Just because they’re a witness doesn’t mean they might not pose a security threat for other reasons.’’

DHS Secretary John F. Kelly and Attorney General Jeff Sessions are in a public disagreement with court officials who have complained that Immigration and Customs Enforcement agents going to local courthouses could scare some victims and witnesses away from reporting or providing evidence of crimes.

Last month, California Chief Justice Tani G. Cantil-Sakauye sent a letter to Kelly and Sessions decrying the practice, saying courthouses “serve as a vital forum for ensuring access to justice and protecting public safety. Courthouses should not be used as bait in the necessary enforcement of our country’s immigration laws.’’

In response, Kelly and Sessions wrote a letter to Cantil-Sakauye saying ICE has a long-standing policy of making arrests at courthouses because it is often the safest place to apprehend criminal suspects, after they have passed through courthouse security screening for weapons. They added that some jurisdictions actively hinder ICE from enforcing immigration laws by “denying requests by ICE officers and agents to enter prisons and jails to make arrests.’’ Such policies, they wrote, made it more necessary to arrest undocumented immigrants at courthouses.

Lapan, the DHS official, made clear in Tuesday’s comments that courthouse arrests by ICE agents are not limited to people who would otherwise be apprehended in a jail or a prison.

“I can’t give a blanket statement that says every witness and victim is somehow untouchable, because they may have circumstances in their own case that would make them again subject to arrest,’’ he said, adding that the factors that could lead ICE agents to arrest a victim or a witness “could be any number of things — again, the categories that we’ve talked about that make them subject to arrest or potential removal still apply to somebody who might him or herself be a victim.’’

While it may be a stated policy to arrest crime victims in some cases, in practice, it seems to happen only rarely.

Critics point to a recent case in Texas as particularly egregious because the woman detained by ICE had gone to court to file a protective order against an alleged abuser, although she herself reportedly had a criminal record and had been previously deported.

Immigration officials offer a special visa program to allow victims of domestic violence, sexual assault and human trafficking to stay in the country. If someone is the immediate victim or witness to a major crime, ICE agents consider that fact when making individual determinations.