DOVER — Detained for nine months, a Somali immigrant was ordered freed after a federal judge ruled immigration authorities denied him due process.

Abdigani Hussein, 45, was released from Strafford County Jail in Dover late Thursday and reunited with his family.

The decision marked a major victory for the American Civil Liberties Union of New Hampshire in its campaign against the U.S. Immigration and Customs Enforcement and some local police departments.

The ACLU-NH maintains federal and certain local law enforcement officials are unconstitutionally jailing immigrant citizens.

Hussein entered the U.S. in 1996 as a refugee and lived in the community until 2002, when he was convicted of possession of khat, a plant native to East Africa, and was sentenced to one year of probation.

Sixteen years later, he was detained and kept in jail for nine months without a bond hearing.

Federal authorities cited new Trump administration guidelines that have expanded these detentions.

“Every person in this country has the right to due process,” said Devon Chaffee, executive director of the ACLU-NH, “Cases like this are exactly why we formed the ACLU-NH Immigrants’ Rights Project, and we are happy to see Mr. Hussein reunited with his loved ones.”

On Nov. 6, a federal judge had ruled that holding Hussein without a bond hearing was unconstitutional.

The hearing was held last Wednesday and Hussein was found not to be a threat and ordered to be released.

“Here, U.S. Immigration and Customs Enforcement prolonged the detention of Mr. Hussein for nine months in violation of his procedural due process rights,” said SangYeob Kim, immigration fellow for the ACLU-NH. “All Mr. Hussein wanted was a bond hearing where he would be given the opportunity to prove that he is eligible for release, which he fortunately received with legal representation. They should provide such due process for all immigrant detainees.”

Legal battles remain, however.

Under recent changes to immigration laws, Hussein’s deportation over the 16-year-old drug conviction is still pending, but ACLU lawyers have vowed to defeat that challenge as well.