The highest court in Massachusetts ruled Monday it is illegal under state law for local law enforcement officers to hold people on detainer requests by U.S. Immigration and Customs Enforcement.

An ICE detainer is as a voluntary request to hold a person in custody for up to two days while ICE looks into the person's immigration status. States that do not adhere to the detainers say the person's criminal proceedings have already been settled and holding them for 48 hours longer violates their constitutional rights.

"[M]assachusetts law provides no authority for Massachusetts court officers to arrest and hold an individuals solely on the basis of a federal civil immigration detainer, beyond the time that the individual would otherwise be entitled to be released from state custody," the Supreme Judicial Court decision on the case Commonwealth vs. Lunn reads.

Though the decision refers to court officers, the Supreme Judicial Court says court officers have the same arrest authorities as other law enforcement agencies so it will now apply to other state and local law enforcement officers.

In the case, Sreynuon Lunn was arrested for larceny, though the district judge dropped the charges. However, ICE had issued a detainer request for Lunn despite his criminal charges being cleared and the state allowing him to be released. So, a judge ordered Lunn detained and he was taken into ICE custody.

Lunn was represented by the American Civil Liberties Union of Massachusetts. Lunn was born in a Thai refugee camp to Cambodian parents fleeing the Khmer Rouge and arrived to the U.S. as a refugee in 1985 before he was even a year old. According to the ACLU, he has raised two children in the U.S. who are both citizens.

The Supreme Judiciary Court head oral arguments in the case in April.

The Trump administration has taken issue with cities that do not follow ICE detainer requests.

"When law enforcement agencies fail to honor immigration detainers and release serious criminal offenders, it undermines ICE's ability to protect public safety and carry out its mission," ICE says on its website.

Cities that do not follow the requests are dubbed "sanctuary cities." The White House in April threatened funding over ICE detainer requests.

"It's just a fundamental principle of law enforcement that if you have a person arrested and another jurisdiction has a charge, then they file a detainer," Attorney General Jeff Sessions said at a White House press conference in April. "And, when you finish with the prisoner, you turn them over to the next jurisdiction for their adjudication."