Migrants convicted of misdemeanors for entering the country illegally were still in detention nearly a week after they were supposed to be released from custody.

On Thursday, attorneys from Federal Defenders of San Diego Inc. – who handle most of the pro bono criminal cases in the Southern District of California, the federal court that covers San Diego – filed an emergency motion before Magistrate Judge Barbara Major seeking the immediate release of one defendant and alerting the court that there were others being held illegally, too.

All the individuals had been sentenced by Major the previous Friday to time served, meaning they should have been released from criminal custody that day. Come Thursday, several had not been.

The motion filed Thursday pertained to Abel Valladares-Cantor, but issues were raised in the motion and in court about other individuals who also remained in custody past their sentence. Valladores-Cantor was sentenced July 27, but remained in criminal detention.

The motion asked the court to order “his immediate release due to his illegal detention in the Southern District of California.”

“Mr. Valladares-Cantor was sentenced six days ago to ‘time served’ for a misdemeanor,” wrote Federal Defender attorney Benjamin Davis in the motion. “This Court issued an abstract on that date ordering that he ‘be released from custody.’ Despite that order, Mr. Valladares-Cantor remains in the same jail in San Diego where he had been detained before his conviction and the imposition of the time-served sentence.”

The U.S. Marshal Service told the defense attorneys on Aug. 1 that the delay in releasing Valladores-Cantor and several others was due to an “accidental error in their tracking system that caused a delay in sending the release orders to [the Western Regional Detention Facility]” and said that the individuals would all be released that day, according to the motion. The Marshals said “they had taken steps to ensure that this particular error did not reoccur.”

But by Thursday, Federal Defenders of San Diego learned that Valladores-Cantor and others remained in custody.

“The evidence in front of me shows that I sentenced him to time served on July 27,” Major said during the hearing. “Any reason why I shouldn’t order that he be released immediately?”

The federal prosecutor did not provide a reason.

“I’ve ordered them to be released today,” Major said. “I ordered them to be released Friday. So, make it happen, Government.”

The defense attorney present at the hearing, Roxana Sandoval, told Major that there were other individuals still in custody who had been sentenced to time served days ago. Her colleagues were at the California Western Detention Facility, run by the private GEO Group, trying to get a full list, Sandoval told Major.

Major said to give her and the U.S. attorney’s office the list when they had them, so that they would all be released immediately.

Sandoval later told Voice of San Diego that nine people were impacted by the tracking error.

Sandoval also noted to the judge that two other clients who pleaded guilty were sentenced to time served on a Friday and who were not released until the following Wednesday.

Another issue delaying people’s release from criminal custody, according to the motion, appears to be immigration detainers –requests from immigration agencies, like Immigration and Customs Enforcement or Border Patrol, that individuals be held in custody after they’ve served their time so immigration officials can retrieve them.

California laws limit when jails can hold individuals for ICE. But the U.S. Marshals Service is a federal agency, so it wouldn’t be bound by state laws.

In the motion, Davis further describes that other people who pleaded guilty and received time-served sentences are being returned to and held at Border Patrol stations for an additional three to seven days.

Federal Defenders of San Diego was contacted in late July by worried family members who told attorneys that their loved ones had been given time-served sentenced but had not yet been returned to Mexico.

“A husband was panicked over his inability to find his wife, a father was panicked over his inability to find his son,” wrote Davis in the motion.

Those clients had pleaded guilty on July 20. They remained at the GEO Western Regional Detention Facility in San Diego until July 23, when they were picked by Customs and Border Protection, according to the motion.