BOSTON, Massachusetts — A US District judge sentenced a Boston man to 17.5 years in federal prison Thursday on charges of plotting to kill Americans by joining militants in Yemen and spreading Al-Qaeda publicity.

US District Judge George O'Toole delivered his sentence to Tarek Mehanna, 29, after a two-hour hearing. The prison sentence is to be followed by seven years of supervised release.

Suggesting he belonged to the ranks of great historical leaders who fought against oppression, Mehanna told O'Toole he refused to be an informant. He addressed the judge for about 20 minutes with a polished delivery.

"I stand before you in this courtroom as a very proud Muslim," he said, defiantly.

His father Ahmed, who emigrated to the United States from Egypt in 1980, said he had lost his trust in the US judicial system.

"Then I was full of confidence in the judicial system," he said. "Now, my confidence is degraded with witnessing the proceedings of my son's life."

The younger Mehanna's court-appointed attorney J.W. Carney claimed the trial was "all political."

A Boston jury in December found Mehanna guilty on five terrorism-related charges and three others related to lying to FBI and other federal officials. During the eight-week trial, the jury heard how Mehanna and his co-conspirators planned to join violent extremist groups and fight against US interests.

He traveled to Yemen in 2004 to seek training to fight in Iraq, but then returned to the United States where he began to translate and spread Al-Qaeda recruitment postings and videos on the Internet, according to prosecutors.

He lied about the trip when questioned by US authorities in 2006, prosecutors said.

Mehanna's lawyers have argued that he never sought to join any armed group and that his Internet activities were protected by US free speech guarantees.

His co-conspirators were named as Ahmad Abousamra and Daniel Joseph Maldonado, aka Daniel Aljughaifi. Another alleged co-conspirator was not identified.

Maldonado pleaded guilty in US District Court in 2007 to traveling from Houston, Texas to Africa in November 2005 and then to Somalia in December 2006 to join Al-Qaeda and other militants to fight the Somali government, the Justice Department said in a statement.

He was sentenced to 10 years in prison, the maximum statutory penalty for receiving military training from a terror group.