The Massachusetts Supreme Court on Monday ruled that state law does not allow local officials to detain illegal immigrants and others at the request of federal immigration authorities.

Federal immigration detention orders are not enough for state officers to hold individuals, according to the court ruling.

"Nothing in the statutes or common law of Massachusetts authorizes court officers to make a civil arrest in these circumstances," the ruling stated.

The decision stems from the case Commonwealth vs. Sreynuon Lunn, ABC affiliate WCVB reported. Lunn, originally from Cambodia, was arrested for robbery in October 2016 but the case was later dismissed. Lunn was kept in custody after the case was dismissed, however, because of a detainer issued by the Department of Homeland Security.

Immigration and Customs Enforcement places detainers on suspected illegal aliens who have been arrested on local criminal charges so they can take custody of them when they are released from local custody.

Lunn's attorneys filed a petition, citing a violation of his Fourth and Fourteenth Amendment rights.

"Massachusetts law enforcement officers cannot arrest people merely because someone else asks them to, even if that someone else is the federal government," the American Civil Liberties Union of Massachusetts argued in a court filing.

The state's highest court seemed to agree with the ACLU.

"Massachusetts law provides no authority for Massachusetts court officers to arrest and hold an individual solely on the basis of a Federal civil immigrations detainer, beyond the time that the individual would otherwise be entitled to be released from State custody," the court ruled.

The court left it up to the legislature to change the law if state lawmakers see fit, writing that it is not the court's place to create or define a new authority for officers to arrest and detain people under federal immigration law.

The legal director of the Massachusetts ACLU, Matthew Segal, tweeted out the court ruling.

BREAKING: Massachusetts Supreme Judicial Court rules that it is illegal (under state law) for MA officers to hold people on ICE detainers. pic.twitter.com/iDLE5AWcdU — Matthew Segal (@segalmr) July 24, 2017

The ACLU applauded the decision despite President Donald Trump's aggressive approach to illegal immigration since taking office.

"At a time when the Trump administration is pushing aggressive and discriminatory immigration enforcement policies, Massachusetts is leading nationwide efforts by limiting how state and local law enforcement assist with federal immigration enforcement," the ACLU said.