SAN FRANCISCO  — The chief justice of the California Supreme Court asked federal immigration agents Thursday to stop making arrests at courthouses, saying "stalking undocumented immigrants" at the facilities thwarts people's access to justice.

Chief Justice Tani G. Cantil-Sakauye wrote in a letter to top federal officials that she is concerned about recent reports of immigration agents going to the courts to track down immigrants for arrest, saying the practice will affect the public's confidence in the court system.

"Courthouses should not be used as bait in the necessary enforcement of our country's immigration laws," she wrote in the letter to Attorney General Jeff Sessions and Homeland Security Secretary John Kelly, adding that crime and domestic violence victims and witnesses all go to the courts seeking justice and due process of the law.

Immigration and Customs Enforcement had no immediate comment on the letter. A Justice Department spokesman also declined to comment.

It comes amid a series of reports of arrests at courthouses in California, Oregon and Texas as federal immigration agents have been called on to step up deportations under President Donald Trump.

Last month, immigration agents in Texas arrested a woman at an El Paso courthouse while she was obtaining a protection order against an alleged abuser. The arrest sparked an outcry from victim's advocates, saying it would dissuade others from coming forward to report abuse for fear of being deported.

ICE also has made arrests in recent months at courthouses in Oregon and Southern California, according to the agency.

Courthouses can be seen as a relatively safe place for federal immigration agents to make arrests because people pass through metal detectors to enter. But many advocates for immigrants and victims decry the practice, saying immigrants will be afraid to report crime or show up for hearings.

"Enforcement policies that include stalking courthouses and arresting undocumented immigrants, the vast majority of whom pose no risk to public safety, are neither safe nor fair," Cantil-Sakauye wrote. "They not only compromise our core value of fairness but they undermine the judiciary's ability to provide equal access to justice."

Several years ago, advocates raised concerns about deportation agents making arrests at courthouses in California's Kern County. At that time, ICE said it would refrain from making such arrests, except in "exigent circumstances."