A man accused of plotting bombings in the UK told a contact he was working for al-Qaeda's third-in-command, the Old Bailey has heard.
Babar said he met two of the accused in Pakistan in 2003
Omar Khyam, of Crawley, West Sussex, also offered to organise explosives training, witness Mohammed Babar said.
Babar said he was urgently summoned to a meeting with Mr Khyam and another alleged plotter, Waheed Mahmood, while they were all in Pakistan in 2003.
Mr Mahmood, Mr Khyam and five others deny conspiracy to cause explosions.
Pakistani-born US citizen Babar, who is giving evidence for the prosecution and has been given immunity from UK charges, said he had been at a wedding in Lahore in March 2003 when Mr Mahmood called to say they needed to see him "right away".
At the meeting, Babar, 31, said Mr Khyam told him: "We are working for Abdul Hadi" - a man the court had earlier heard described as al-Qaeda's number three.
Babar, who has pleaded guilty to terrorist-related offences in New York, said he understood the "we" meant Mr Khyam, Mr Waheed and a third accused, Salahuddin Amin.
He described a second encounter with Mr Khyam and another man they knew, when he allegedly said he knew someone who could offer them explosives training.
Mr Khyam, Babar said, had told him there were "brothers" who were using aluminium powder and refined sugar.
"Although they did not say, I was under the impression that it was Ausman (Khyam) and Waheed who were offering the training," Babar said.
Babar described how he came to Britain in April 2003 to raise money for a training camp.
He met some of the accused who said they had set up a similar camp in Kashmir to give training in firearms, explosives and hijacking.
Babar said Mr Mahmood had said they took only people who wanted to go to fight in Afghanistan.
But he said: "I didn't think they had any intention of sending people into Afghanistan.
"They only said it so people would come. Then they were telling them it was difficult and they could not go and fight.
"There was only one other option - working with them in the UK."
Suspects Salahuddin Amin, 31, from Luton, Bedfordshire, and Mr Khyam, 24, were alleged by the prosecution to have received training in explosives and use of the poison ricin in Pakistan.
Mr Mahmood, 34, Mr Amin, Jawad Akbar, 22, Mr Khyam and his brother Shujah Mahmood, 19, all of Crawley, West Sussex, Anthony Garcia - also known as Rahman Adam - 23, of Ilford, east London, and Nabeel Hussain, 20, of Horley, Surrey, deny conspiring to cause explosions.
Mr Khyam, Mr Garcia and Mr Hussain deny possessing ammonium nitrate fertiliser.
Mr Khyam and Shujah Mahmood deny possessing aluminium powder.
The trial continues.