A Syrian asylum-seeker has gone on trial in Germany accused of being a member of Islamic State (IS) and scouting out Berlin landmarks for a possible attack.
The hearing began two weeks after an attack on a Christmas market in the German capital, in which 12 people were killed and dozens more were injured.
IS said one of its members, a 24-year-old Tunisian who was shot dead days later by Italian police, carried out that attack.
Prosecutors do not believe that Shaas al-Mohammad, the 20-year-old defendant now on trial, was involved in the Christmas market attack, but cited it as one reason for allowing the public to observe the trial.
Judges rejected a defence motion to exclude the public due to the defendant's young age.
Federal prosecutor Gerwin Moldenhauer told the court that al-Mohammad joined IS in Syria in 2013 and underwent military training.
He then allegedly performed armed guard duty during the siege of the eastern Syrian city of Deir el-Zour and its airport in 2013 and 2014, and also helped transport supplies for the group.
Prosecutors alleged that he remained in the service of IS after coming to Germany as an asylum-seeker in summer 2015.
Phone records, WhatsApp messages and other evidence showed that al-Mohammad sent his IS contact details about tourist groups visiting Berlin's Brandenburg Gate, Alexanderplatz and the Reichstag parliament building in apparent preparation for an attack, they said.
Prosecutors also said that al-Mohammad recruited at least one new member, offered himself as a contact for extremists planning attacks in Germany, and even offered to carry out an attack himself or return to Syria to fight for IS.
He is charged with membership in a foreign terrorist organisation and violating weapons laws.
Al-Mohammad, seated behind a pane of reinforced glass, confirmed his name, address, date and place of birth to the judge but declined to state his last occupation.
The defendant, who has been in jail since his arrest on March 22, told the court through a translator that he would not make statements or answer questions during cross-examination.
His lawyer told the court that al-Mohammad was not a member of IS but of a different group, called Jund ar-Rahman, who had no motivation to carry out attacks in Germany.
Tarig Elobied said WhatsApp chats - in which his client allegedly went by the name "He who yearns for paradise" - showed he had not sworn allegiance to IS.
After the hearing, Mr Elobied said his client's trial had already been influenced by the Christmas market attack, citing the court's dismissal of his motion to exclude the public.
"We as Berliners are affected by this and of course the judges, who work in Berlin, are affected too," Mr Elobied said.
The trial is scheduled to continue until April.
Court spokeswoman Lisa Jani said the possible sentence al-Mohammad could face depended on whether he is convicted under juvenile or adult law.
The former entails a maximum sentence of five years, while the second could result in a maximum sentence of 10 years in prison.