TUCSON, Ariz. ― Immigrants facing prosecution for crossing the border illegally appeared before a judge without shackles for the first time in years here Tuesday, after a landmark ruling ordered the federal courts in Arizona to stop routinely restraining people who don’t present a security threat.

The ruling applies to anyone facing federal criminal charges in Arizona. But it disproportionately affects Operation Streamline, an immigration-prosecution program that allows judges to group defendants to speed up hearings for those accused of crossing the border illegally.

Some public defenders and immigrant rights groups viewed the change as a positive, if limited, development. Bob Libal, director of the Texas-based group Grassroots Leadership, told HuffPost: “It makes the process seem less overtly dehumanizing. I think it’s a good thing that people aren’t in shackles, and it’s a terrible thing that we’re prosecuting dozens and dozens of people daily for the crime of coming to the country.”

While security policies differ across the federal court system, Cesar Cuauhtémoc García Hernández, a professor at the University of Denver Sturm College of Law, said wrist and ankle cuffs are generally unnecessary in prosecutions over petty immigration crimes.

“If they think that immigration crime defendants prosecuted through Operation Streamline are especially likely to endanger the public, they can present that evidence to a judge and ask for restraints,” García Hernández wrote in an email to HuffPost. “Most immigration crime defendants have no history of violence, thus the reality is that there is probably not any such evidence that could be presented for most people in Operation Streamline precisely because they are not dangerous.”

Operation Streamline, launched in 2005, is used in several federal courts near the Mexico border. But the federal courthouse in Tucson handles a particularly large load, processing as many as 75 cases a day. Until Tuesday, people facing charges under the Streamline program were routinely lined up before a U.S. magistrate judge while shackled at the wrists and ankles.

The 9th U.S. Circuit Court of Appeals issued a ruling May 31 that it is unconstitutional to indiscriminately force defendants to appear before a federal judge in shackles. Instead, judges have to decide if each individual defendant poses a security risk that would require restraints.

“A presumptively innocent defendant has the right to be treated with respect and dignity in a public courtroom, not like a bear on a chain,” the opinion reads.

After that ruling, federal public defenders in Arizona began asking judges without success to unshackle clients facing prosecution for various crimes, including crossing the U.S.-Mexico border illegally. On Friday, the 9th Circuit ordered the Arizona federal courts to follow the opinion it issued in May.

Scrambling to comply with the order, the federal court in Tucson canceled Operation Streamline for the day on Monday.

The U.S. Marshals Service, which handles security for the federal court system, appeared to think the changes merited new measures. In Tucson’s Streamline proceedings, dozens of daily defendants usually appeared before the judge all at once, seated in rows of chairs before approaching the bench in batches, typically to plead guilty in exchange for a reduced sentence.

Without the shackles, however, the U.S. marshals are allowing only seven defendants to appear in the courtroom at a time. The number of Border Patrol agents assigned to the courtroom where Operation Streamline cases are heard will now likely double to six, according to an email to Tucson judges and staff from Richard Tracy, assistant chief deputy of the Marshals Service.

The email, obtained by HuffPost, states that lawyers may waive their clients’ right to appear unshackled and that the “immediate perimeter around unrestrained prisoners in court needs to be closed.”

“Flexibility is vital to ultimately strike a balance between security (our primary concern) and efficiency,” the email reads.

The U.S. Marshals Service did not answer phone calls or an email requesting comment. The Department of Justice, which oversees the Marshals Service, declined to comment, citing security concerns.

But as of Tuesday, when Streamline proceedings resumed, only two U.S. marshals were visible in the courtroom, as well as one Border Patrol agent. The chairs where the dozens of defendants used to sit remained empty as groups of seven people at a time approached microphones before U.S. Magistrate Judge Velasco. The defendants uniformly pleaded guilty.

The ruling’s effects are limited to the moment when defendants appear before a judge. Under Operation Streamline, defendants meet with their court-appointed lawyers in the same courtroom where the hearings are held. At those meetings, the defendants remain cuffed at the wrists and ankles. The shackles also return once they leave the courtroom after conviction, according to attorney Rosemarie Valdez.

“The decision only applies to court proceedings,” Valdez, who worked on Operation Streamline cases Tuesday, told HuffPost. “Otherwise, they’re going to be shackled and chained.”

While residing without authorization in the United States is a civil offense, those caught crossing the border illegally often face criminal prosecution. The first offense is a misdemeanor carrying a jail sentence of up to six months. Those caught crossing again after being deported face felony charges with maximum sentences ranging from two to 20 years, depending on their criminal records. In practice, most people convicted on immigration offenses serve shorter sentences.

Prosecutions for immigration offenses in recent years have grown to take up roughly half of the federal criminal docket. And since President Donald Trump took office, the Tucson court has focused on increasingly petty crimes.

In February, Attorney General Jeff Sessions asked federal courts in all 94 districts to prosecute immigration-related crimes more aggressively and for border districts like Arizona to submit plans outlining how they would handle misdemeanor cases of first-time offenders caught crossing the border illegally.

The Tucson division of U.S. Customs and Border Protection embraced Sessions’ directive. Last week, CBP trumpeted the new policy in Tucson of prosecuting first-time immigration offenders ― a practice that the jurisdiction had largely discontinued about three years ago, instead choosing to refer mostly repeat offenders for prosecution. HuffPost first reported that change in policy in June.

On Tuesday, more than 50 defendants faced criminal charges for crossing the border illegally for the first time, according to Valdez. U.S. Magistrate Judge Bernardo Velasco uniformly sentenced them to time served, which was generally one to five days. After conviction, the defendants will be deported.

It’s unclear how the ruling will affect immigrant prosecutions in the future, according to Cosme Lopez, a spokesman for the U.S. Attorney’s Office in Arizona.

“We’re waiting for everything to clear,” Lopez told HuffPost. “We’re taking it one day at a time.”

The U.S. District Court for the state of Arizona has until Friday to respond to last week’s ruling ordering the state to stop routinely shackling defendants. The order may change after it does so.