A boy accused of planning a terrorist attack in Cardiff searched the internet for details of security at a Justin Bieber concert, a court has heard.
The 17-year-old from Rhondda Cynon Taff, who cannot be named, also wrote a note with bullet points including “run down the non-believers with a car”.
Police found a claw hammer, a kitchen knife and a “martyrdom letter” in his rucksack, Birmingham Crown Court heard.
He denies preparing to commit acts of terrorism.
The court heard the boy, from a white British background, was radicalised online.
Matthew Brook, prosecuting, said a note found in the boy’s bedroom read: “I am a soldier of the Islamic State.
“I have attacked Cardiff today because your government keep on bombing targets in Syria and Iraq. There will be more attacks in the future.”
Mr Brook said a copy of a poster relating to the concert was found on the defendant’s computer.
On 29 June, one day before the Canadian singer’s concert, Mr Brook said a media file was created on the defendant’s computer showing a poster for the gig at Cardiff’s Principality Stadium.
Jurors were told the accused also searched for “Justin Bieber Cardiff security”.
The court heard he downloaded plans of Bridgend’s McArthur Glen shopping outlet just minutes after researching “vehicle ramming attacks.”
Mr Brook said the defendant had been posting material on Instagram, including images of terrorists, pictures of the IS flag and images “encouraging a terrorist attack on Cardiff”.
“He had terrorist material stored on his computer, he published posts on Instagram which encouraged terrorism and he was planning a lone wolf-style attack in the name of Islam,” Mr Brook added.
After police went to his home, he told them his Instagram account password was “TruckAttack” and they seized his mobile phone.
A laptop found at the property had two copies of a propaganda magazine containing instructions on how to carry out knife and vehicle attacks.
Mr Brook added: “Inside the rucksack they found a large kitchen knife and a hammer. Also, inside it was a martyrdom letter – a note saying that he was a soldier of the Islamic State and he had attacked Cardiff.
“Why would he write such a letter? Because, if you are going to commit a terrorist attack in which you presume you will die, you need people to know afterwards why you did it.”
The court heard the boy had told police he had been talking to someone on Instagram for about a week who told him he would go to hell because he did not believe in Islam and he needed to perform an act of terrorism if he wanted to go to paradise.
The court heard the defendant had not intended his Instagram posts to do any harm and had not intended to harm anyone with the knife and hammer found in his bag.
The trial continues.