MINNEAPOLIS — A man who was sentenced to prison for leaving the U.S. in 2007 and joining the terror group al-Shabab in Somalia has served his time and is scheduled to be released from a federal facility in Rochester on Thursday, according to the Federal Bureau of Prisons website.

However, Abdifatah Yusuf Isse will not immediately be freed. The 31-year-old, who is not a U.S. citizen, is being transferred into the custody of Immigration and Customs Enforcement and placed into removal proceedings, said Ben Petok, a spokesman for the U.S. Attorney's Office in Minnesota.

Isse's attorney, Paul Engh, said: "He's done his time. He still has an ICE hold, and we're working on resolving those matters." If allowed to remain in the U.S., Isse would like to live in Seattle, where he has family, Engh said.

Isse pleaded guilty in 2009 to one count of providing material support to terrorists. He was sentenced in 2013 to three years in prison, followed by 20 years of supervised release. His release Thursday takes into account credit for time served and good time.

He was among at least 22 young Somali men who have left Minnesota since 2007 to join the terrorist group in Somalia. At least nine are dead or feared dead by family members, some have been charged, and several remain at-large.

Isse, who was a cooperating witness in the government's case against another man, testified that he and other young men left Minneapolis in 2007 and eventually went to Somalia. Isse said he wanted to fight Ethiopians, who were seen by many Somalis in the U.S. as unwelcome invaders of their homeland. He testified he didn't know what al-Shabab was until he reached Somalia.

He told the court he spent time at an al-Shabab safe house — where he received limited weapons training and raised funds to buy an AK-47 — then went to another location and began helping clear trees for a training camp. He left the camp after about a week and eventually returned to the U.S.

At his sentencing hearing, Chief U.S. District Judge Michael Davis said he was taking a chance on Isse, who faced up to 15 years in prison.

"When you walked away (from the camp), when you devised a scheme to get away, that told me a lot about you," Davis said, according to a transcript of the May 14, 2013, hearing. "If you had been involved in the ambush, you would be doing a lot of time."

Davis also said that if Isse is not deported after his prison term, he would be under "high supervision."

Isse told the judge: "I'm really sorry I went back to Somalia. I shouldn't have done that ... I promise you I will never be in trouble again."

Isse served most of his prison sentence at a low security facility in North Carolina. He was transferred to the federal medical center in Rochester sometime in the last week or two, Engh said.