The master of a container ship locked four stowaways in quarantine after fearing they were Boko Haram terrorists, a court has heard.
The men, from Nigeria and Liberia, allegedly armed themselves with metal poles and threw faeces onboard the ship in the Thames Estuary in December.
Samuel Jolumi, 27, Ishola Sunday, 28, Toheeb Popoola, 27, and Joberto McGee, 20, deny attempting to hijack the ship.
Antonio Raggi told the Old Bailey he was “worried” for his crew’s safety.
The men, who also deny making threats to kill and affray, had been discovered six days into the voyage from Lagos, Nigeria, to Tilbury in Essex.
Mr Raggi, master of the Italian-flagged Grande Tema, said: “For me, these guys could be terrorists, Boko Haram, I don’t know.
“They come on board, they break the safety, the security of the vessel.
“My problem is if these guys have put something in a part of the vessel and after are going to come and get weapons.”
The men were discovered near the Canary islands in a “very dangerous” lower area of the ship, Mr Raggi said.
He said the only safe living area for them was the quarantine room and a ship’s master effectively acts as the police under Italian rules in international waters.
He also said Italian legislation dictates that weapons are forbidden on the ship, meaning his crew were unarmed.
But after five days in quarantine the men allegedly broke free and ran amok, arming themselves, making throat-cutting gestures and hurling faeces as most of the crew retreated to the safety of the bridge.
The 14-hour stand-off was brought to an end when special forces swooped under the cover of darkness in the Thames Estuary late on 21 December last year, the court has heard.
The trial continues.