© The Associated Press / U.S. Attorney's OfficeThis undated photo provided by the U.S. Attorney's Office shows Betim Kaziu. Kaziu has been charged with plotting to provide support to overseas terrorists and the star witness against him is his former friend who has pleaded guilty to the charges.
A Brooklyn-born man was convicted Thursday of terror charges for traveling to the Middle East to avenge abuse of Muslims in a trial that featured the testimony of a would-be terrorist and childhood friend of the defendant who became a government cooperator.

The jury deliberated less than four hours before finding Betim Kaziu guilty of conspiracy to provide material support to a terrorist organization, conspiracy to commit murder and other charges. Kaziu had denied ever being a threat. He faces a maximum of life in prison at his Nov. 4 sentencing.

"Through our judicial system, we have brought to justice a homegrown terrorist who conspired to kill U.S. troops overseas," U.S. Attorney Loretta Lynch said in statement. "We are committed to using all available tools to combat terrorism wherever it threatens our citizens and our country."

Unlike the cases of Najibullah Zazi, mastermind of a foiled suicide attack on New York City subways, or Faisal Shahzad, the failed Times Square bomber, Kaziu's suspected exploits received little attention, in part because the plot didn't get far. But his case had many of the same themes of homegrown terrorism.

Prosecutors alleged that Kaziu, 23, and star witness Sulejah Hadzovic - two U.S.-born sons of Islamic immigrants from the former Yugoslavia who met in sixth grade - traveled to Cairo in 2009 in hopes of taking up arms against U.S. troops.

"We were upset at what was happening in places like Abu Ghraib prison and Guantanamo Bay, how they were humiliating and torturing Muslims there," Hadzovic testified. "It's what ultimately made us want to go and fight in jihad."

He also told jurors he grew to believe that he could no longer live in the United States because "being a Muslim, we're stereotyped and somebody sees somebody with a beard, they automatically label him a terrorist."

Hadzovic, 21, said that while they were in Egypt the pair attended school, sought to obtain AK-47s and considered whether to take up arms in Iraq, Afghanistan, Pakistan, Palestine or Somalia.

But Hadzovic said he began to waver after hearing President Barack Obama's speech in Cairo in 2009 that extended a hand of friendship to Islam. Kaziu, he said, told him: "Don't let (the speech) fool you. It's like throwing sand in your eyes to blind you from the truth."

Defying his friend, Hadzovic returned to New York. About three week later, federal authorities approached him and demanded answers about his travels.

He eventually agreed to plead guilty and cooperate to avoid charges carrying a potential life sentence. He now faces a maximum 15 years in prison.

Prosecutors say that once on his own, Kaziu tried, but failed, to join al-Qaida groups in Iraq, Afghanistan and the Balkans. He eventually made his way to Kosovo.

On the Albanian coast, he recorded a video that a prosecutor described as "his goodbye, contemplating how he would soon depart for paradise - a reward for those who die a martyr," and had bought a plane ticket to Pakistan. But authorities said he was captured local authorities before he could make the trip.

The defense claimed the alleged martyr video and other home videos shot by Kaziu were made in jest. His lawyers also argued that most of evidence against their client was widely distributed anti-American propaganda.