The government agreed Wednesday to throw out all remaining charges against a Saudi graduate student whose terrorism case was seen as an important clash between free speech and the war on terror.

The government agreed to dismiss the immigration charges against Sami Omar Al-Hussayen (search), 34, in return for his dropping an appeal of a deportation order.

"He's going back to Saudi Arabia (search)," defense attorney David Nevin said. "This long ordeal has come to a close."

Al-Hussayen was acquitted in early June of using his computer skills to support terrorism, along with three other immigration violations. But the jury deadlocked on eight additional charges — all of which were dropped Wednesday.

Raw Data: U.S. v. al-Hussayen (FindLaw pdf)

Prosecutors said Al-Hussayen set up and ran Web sites that were used to recruit terrorists, raise money and disseminate inflammatory rhetoric.

But the defense claimed Al-Hussayen, a father of three and a devoted Muslim, was only volunteering his ability to maintain Web sites that were promoting Islam. Any radical material on the sites did not reflect Al-Hussayen's views and was protected by the Constitution, Nevin said.

The case against Al-Hussayen, a Ph.D. candidate in computer science student at the University of Idaho, was seen as an important test of a provision of the Patriot Act (search) that makes it a crime to provide expert advice or assistance to terrorists.

U.S. Attorney Tom Moss said that even if Al-Hussayen was convicted on the remaining charges, he would have likely been sentenced to time served and deported anyway, making any further court action a needless expense.

"It is in the best interests of the people of the United States that Mr. Al-Hussayen leave the country as soon as possible, and this agreement accomplishes that," Moss said.

The son of a prominent Riyadh family whose education was being financed by the Saudi government, Al-Hussayen has been jailed since his arrest in February 2003.

He was ordered deported last year but kept in the United States for trial. His wife and three sons returned to Saudi Arabia in January rather than fight deportation themselves.