"I would be remiss if I did not say that the procedures that are normally followed in criminal cases were not followed in your case, and for that, you have the apology of the United States government," Rosen said during the sentencing. "Some of the procedures failed you and, unfortunately, failed the system in this case."
The apology, rare but not unprecedented, ended the criminal proceedings against one of the four men accused of being in a sleeper terrorist cell in Detroit in the aftermath of September 11.
U.S. Attorney Stephen Murphy said the Justice Department is "not going to take a position" on the judge's statement.
He said he was "glad that we were able to work out an agreement."
Still, some questioned the fairness of allowing Hannan to serve so much time.
"This was a horrible miscarriage of justice," said Mark Kriger, a Detroit defense attorney. "No one should serve 43 months for an offense that can only carry six months. That's time that can never be given back."
The Justice Department spent millions of dollars, conducted hundreds of interviews around the globe and generated thousands of records in its zealous prosecution of four men it said were an "operational combat cell" plotting terror attacks in Metro Detroit and abroad.
The men's arrests Sept. 17, 2001, resulted in worldwide headlines. A month later, Attorney General John Ashcroft said the men were suspected of having knowledge of the Sept. 11, 2001, attacks, a claim he quickly retracted.
Instead, prosecutors won a conviction based on the admission of an immigrant who said he attempted to scam $2,200 out of an automobile insurance company by faking injuries from a July 5, 2001, accident in Dearborn -- a charge so minor prosecutors declined to bring it as a separate offense during the first trial. During the trial, prosecutors alleged that the accident was an example of "economic jihad" designed to raise money to fund terror operations.
The conduct of the former lead prosecutor, Richard G. Convertino, remains the subject of a criminal investigation, which expanded to include his handling of other criminal cases. Convertino's lawyer, William Sullivan, has said his client did nothing wrong. Rosen threw out the terror convictions in 2004.
In June 2003, a jury convicted two men, Abdel-Ilah Elmardoudi and Karim Koubriti, of supporting terrorism, but found Hannan not guilty of the charge. The jury did find Hannan guilty of a false documents charge.
Richard Friedman, a University of Michigan law professor, said it's extremely rare for a person to serve more than the maximum sentence.
"That's what bail is for typically," Friedman said. "It's a steep price."
Government lawyers have denied the prosecution on the fraud charge was motivated by malice, but by the fact Hannan committed a felony -- mail fraud. Former U.S. Attorney Craig Morford said earlier a goal of the charge was to ensure deportation.
"The government needed to save face. You can't go from having the first terror trial with the possibility of life imprisonment to: 'We're sorry and please leave,' " said Peter Henning, a Wayne State University law professor and a former federal prosecutor.
The taxpayer-paid defense of the four men alone cost more than $1 million, court records show, while the 2003 trial cost hundreds of thousands of dollars in security and court costs.
After Hannan's indictment on the fraud charges in 2004, he planned to await trial to clear his name and stay in the United States but decided he couldn't wait another six months to a year to stand trial.
"He lost the will to fight anymore," said his lawyer, James C. Thomas. Last month, a fellow inmate at the Wayne County Jail knocked out three of Hannan's teeth, Thomas said.
He spent months in solitary confinement with little access to reading materials while he was a terror suspect, Thomas said. "This was very hard time to serve."
The government said Tuesday it was taking steps to ensure the rights of Hannan's co-defendant, Koubriti, were not violated.
Koubriti is to go on trial this summer on the fraud charge. He is being held at a Detroit halfway house.
Elmardoudi is working to resolve an outstanding criminal charge in Minnesota stemming from his allegedly stealing telephone access codes at Minneapolis International Airport. Elmardoudi faces no charges in Detroit, but could be charged by federal prosecutors in Iowa.
Hannan came to the United States in late 2000, taking a string of jobs, including working for an airport caterer at Detroit Metropolitan Airport.
Thomas said he expects Moroccan authorities will arrest and interrogate Hannan upon his arrival because he's been labeled a terrorist. He planned to get a copy of the transcript of Tuesday's hearing to give to Hannan to show to Moroccan authorities.
Hannan didn't speak at the sentencing. Under the sentence, he will pay no fine and make no restitution. A $100 assessment will be paid out of an account raised by local lawyers on his behalf.
"This is the end of a long and painful road," said Thomas, who called Rosen's apology "wonderful."
When Hannan, Karim Koubriti and Farouk Ali-Haimoud were arrested Sept. 17, 2001, by federal agents at a southwest Detroit flat, agents found a day planner that had suspicious drawings, expired badges for the airport caterer and phony IDs.
Ali-Haimoud, who was found not guilty on all charges, filed a libel suit in U.S. District Court against a publisher who called him a convicted terrorist in a book.
He is living in Florida, working in a construction job and doing well, said his lawyer, Robert Morgan.