“He said violence was necessary to remove the United States military and it was justified.”

Ujaama said that he ran Hamza’s website, helped set up the jihad training camp and ultimately delivered a teenage recruit and cash to Afghanistan.

After the American government had declared the Taliban a terrorist organisation, Ujaama said Hamza’s “view was they (Taliban) were a good government and a proper Islamic government that should be supported by Muslims”.

Ujaama received six years jail in the US for his role in setting up the alleged jihad training camp in Oregon and delivering Feroz Abbasi, a young British follower of Hamza, to the front lines in Afghanistan.

He told the court he agreed to testify against others in exchange for a shortened jail sentence.

Looking nervously at Hamza, who is appearing in New York Federal Court minus his trademark hook, he told how he became close to the cleric while working for him between 1999 and 2001.

He said he moved from Seattle to London to run Hamza’s Supporters of Sharia websites and magazine and taught other young radicals how to download and edit material including Hamza’s speeches and sermons.

Mr Abbasi, then in his late teens, was one of his students and Ujaama said he agreed to take him to the Afghan front line before the September 11 2001 terrorist attacks.

“Abu Hamza gave me the order,” he said. “He ordered me to take Feroz Abbasi to Afghanistan.

“He told me to take him to a sheikh who was a front line commander – someone who was like a general on the battlefield.”

Mr Abbasi was detained in late 2001 by US forces and held for four years at the Guantánamo Bay detention centre, but was later released without charge. Now back in Britain, he continues to protest his innocence.

Ujaama was also asked about events in Yemenn. “I recall Abu Hamza mentioning a satellite phone he wished he had sent after a friend of his son was sent over there,” he said.

Hamza is accused of providing financing and a satellite phone to hostage takers in the Yemen in 1998. Three British tourists and an American died as rescuers tried to free them.

Grey-haired, bespectacled Ujaama said that he first met Hamza when he travelled to London and listened to his sermons and speeches at the Finsbury Park Mosque.

“My relationship with Abu Hamza became very close between 2000 and 2001, prior to that I was establishing a very close relationship with him in 1999.”

Asked how he was paid, Ujaama said: “I was permitted to take money from the collections and use that for living and travel expenses.

“There were collections for an immigration fund, for people to immigrate to the Islamic country of Afghanistan.

“The money was raised through collections at the mosque and in jars distributed throughout London and by way of donations by members of the mosque.”

Hamza, who was extradited from Britain in 2012, has pleaded not guilty to 11 terrorism charges and faces life in jail if convicted. The trial continues.