DC Mark White, a member of Police Scotland’s organised crime and counter-terrorism team, was giving evidence at the trial of Yousif Badri, 29, who denies three charges under the Terrorism Act.
The jury at the High Court in Glasgow was shown a manual running into dozens of pages.
Advocate depute Richard Goddard, prosecuting, asked DC White what the manual was.
DC White replied: “A manual created by al-Qaeda. This appears to be a scanned copy which has been translated into English.”
The court was shown the document, which refers to jihad and explains how to shoot weapons including automatic pistols and Kalashnikovs and how to avoid detection and prepare false documents.
The court heard the manual referred to explosives, car bombs and how to prepare ricin.
Mr Goddard asked: “Was there much about religion or politics?” The police officer replied: “It is basically a manual if you want to kill somebody or blow something up and how to avoid detection.”
The jury was also shown photographs found on a memory stick taken from the flat. One of them showed a man with his face partially covered with red and white scarf and holding an assault rifle.
DC White was asked if the photograph ressembled anyone and he replied: “I believe it resembles Mr Badri.”
Earlier, DC Gillian Essen told the court that she and colleagues had searched Badri’s flat in Ashgrove Road, Aberdeen, on 6 June 2013.
She said that she was at the time a member of a specialist search team and added: “We did joint training with the army, searching for bombs and bomb parts.”
The court heard that among the items seized by the police during the search was a jar of nails, an external hard drive, a memory stick and three books in Arabic.
DC Essen told the court that the tub of nails was found in a cupboard in a desk.
Badri faces a number of allegations including an accusation he was involved in conduct “with the intention of committing acts of terrorism”.
The offences are said to have been carried out at two places in Aberdeen – Badri’s former flat in and in Berryden Retail Park.
Badri’s current address in Halifax, West Yorkshire, also features in the list of alleged offences.
Prosecutors claim that between 2007 and 2013 Badri collected or made a record of information likely to be useful to a person “committing or preparing an act of terrorism”.
This allegedly included footage of terror attacks as well as instructions on “urban assassinations” and “guerrilla tactics”.
The second charge alleges that Badri “with the intention of committing acts of terrorism” engaged in various actions between 2006 and 2013.
Badri denies all the charges against him.
The trial before judge Lord Turnbull continues.