A jihadi confided in an undercover officer that he would carry out a terror attack in Britain if he was thwarted from going to Syria, a court has heard.
Gabriel Rasmus was "desperate" to join Islamic State but when he was refused a travel visa he considered doing something "similar to what happened in France and Belgium" instead, the court was told.
The 29-year-old was arrested in April last year when he was found hiding in the back of a lorry at Dover in Kent with Anas Abdalla and Mahamuud Diini, both 26 and from Birmingham.
The officer "Muhamed", who had infiltrated their group, gave evidence in the Old Bailey trial of Abdalla and Diini who are also accused of trying to join Islamic State.
It is believed to be the first time that an undercover officer has given evidence in open court in a Syria-related trial.
Speaking behind a screen, Muhamed said he befriended Rasmus - who called himself Abu Junaid - in July 2014 after being tasked with finding Islamic State extremists in the Birmingham area.
Over the next few months, they met regularly at a mosque, restaurants, bars and even at Rasmus's home as well as exchanging text messages.
Prosecutor Sally Howes QC asked: "By this stage had you formed a professional opinion of Abu Junaid - Mr Rasmus?"
Muhamed replied: "He is extreme. He was desperate to go to Islamic State and fight for them."
On meetings in January last year, he said: "He explained me jihad war is not only in Syria in Islamic State, jihad is everywhere. And also he said if he will stay here he will 'do something' - he means some terrorist attack."
Later, as they walked through the Bull Ring shopping centre in Birmingham Rasmus expressed his frustration at not getting to Syria.
"He said (when) we met again in Bull Ring shopping centre he will do something similar to what happened in France and Belgium."
Earlier, the officer told jurors how he met Rasmus at his perfume stall in Coventry Road in the city and they struck up a conversation.
When the officer said he was from Bosnia, Rasmus replied with "glorious words about Bosnian mujahideen during the Bosnian war. He said they did a good job to help Muslims in Bosnia".
Muhamed went on to describe how Rasmus had "whispered" to him about his hopes to join fighters in Syria during a meeting at a pastry house in September 2014.
Rasmus had told him that he had tried to go twice before but had only got as far as Turkey before being sent back to the UK.
The witness said: "He explained me he is not happy here and he wants to go there and he explained me how he supports Isis, Islamic State.
"He asked me do I want to go fight. I said I'm not ready but everything is possible and he said we should go there. That is right thing."
On another occasion, Rasmus allegedly told him that he had tried to persuade his wife to go to Syria for a "holiday" but she refused.
The court heard that he had texted Muhamed about needing more money for "the job" in reference to travelling to Islamic State.
According to Rasmus, Syria was the best place to "fix yourself" and anyone who "wears flowers on their chests" for Poppy Day was no Muslim, the court heard.
Rasmus also allegedly praised the terror attack on the Charlie Hebdo magazine in Paris saying: "Praise to Allah, the brothers did good job."
And he showed the officer a video of extremists lining up hostages and beheading them, the court heard.
Abdalla, of Fox Hollies Road, Acocks Gardens, Birmingham, and Diini, of Coventry Road, Small Heath, Birmingham, deny preparing for acts of terrorism. Rasmus, also from Birmingham, has admitted the charge.