A case before the state's highest court Tuesday could determine just how much local law enforcement are legally allowed to cooperate with federal immigration agents.

The case, Commonwealth vs. Lunn, asks the Supreme Judicial Court (SJC) to decide whether local law enforcement are authorized to detain a person solely at the request of U.S. Immigration and Customs Enforcement (ICE).

An ICE detainer is a request to hold a person in custody whose criminal proceedings have been settled, meaning the charges have been dismissed, they've posted bail, or their jail sentence has been completed. A detainer gives ICE up to two days to look into a person's immigration status and potentially pursue deportation.

In Sreynuon Lunn's case, larceny charges against him were dropped by a district judge. ICE, however, had issued a detainer requesting the court hold Lunn, even though his criminal charges were cleared and he was otherwise free to go. The judge ordered Lunn detained and he was taken into ICE custody.

And this is where the constitutionality of ICE detainers comes into play.

"We're just trying to understand from our perspective as police chiefs, police officers, what can we quote-unquote honor and what can we not honor," said Chelsea Police Chief Brian Kyes.

Kyes is following the hearing before the SJC and hoping the court will hand down clarification when it comes to the role of local law enforcement in fulfilling ICE detainers.

"Right now there's just so much confusion," Kyes said. "It's a very complicated process and we don't want to be put in a position where we're picking and choosing which ones we deem appropriate and which ones are not. We just want a straight answer."

An ICE detainer is not the same thing as an arrest warrant, which requires proof of probable cause and sign-off from a judge, legally empowering police to detain a person. ICE detainers, on the contrary, are voluntary requests coming directly from ICE.

On its website, ICE argues that when local police or courts decline to hold someone on a detainer, the safety of the community is jeopardized.

U.S. Attorney General Jeff Sessions, the nation's top law enforcement officer, says the use of detainers is a common practice.

"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 and when you finish with the prisoner, you turn them over to the next jurisdiction for their adjudication," he said.

And that's the way it works with criminal cases. But immigration law is civil in nature, which means different rules apply.