A 17-year-old will spend at least 11 years in jail for planning an Islamic State-inspired vehicle attack in Cardiff.
Lloyd Gunton was arrested at his home in the Rhondda Cynon Taf area - hours after looking online for the security details of a Justin Bieber concert being held at the Principality Stadium.
Jurors were told the teenager hid a hammer and knife in his school bag and wrote a "martyrdom letter".
Gunton was found guilty of one offence under Section five of the Terrorism Act 2006 in relation to preparation of an act of terrorism and an offence under Section one, concerned with the encouragement of terrorism under the same act.
He was arrested in July 2017 by officers from Wales Extremism Counter Terrorism Unit (WECTU) who have worked jointly with West Midlands Counter Terrorism Unit and the Security Service, MI5, on the investigation.
Detective Superintendent Jim Hall, head of the Wales Extremism and Counter Terrorism Unit, said: “Today’s sentence reflects the gravity of the offences committed by this 17-year-old youth and, I hope, will serve as a deterrent to anyone considering such actions in the future.
“This case has highlighted the ongoing concerns with young people gaining access to extremist material on the internet and how quickly that can lead to radicalisation. This individual actively sought out that material and as he became radicalised his behaviour quickly became a concern.
“We urge people to speak to a family member, teacher or us so that we can intervene at the earliest opportunity to keep the public safe. You will not get into trouble by reporting concerns.
“The reporting in this case has already indicated that this person had intended to attack a concert in Cardiff.
"Police and partner agencies will continue to work together to share information on this offender to ensure there is a robust and effective risk management plan in place for the entirety of his sentence.
“I want to remind the public to be vigilant but assure them that we work closely with venue management, local authorities, Welsh Government and many stakeholders to ensure South Wales is one of the safest areas to visit and enjoy.
“WECTU will continue to protect local communities by working with MI5, other partners and the CPS to pursue and prosecute all those who show support for illegal and extremist organisations or who seek to spread hate and terror."
Anyone who sees or hears something that could be terrorist-related should act on their instincts and call the police in confidence on 0800 789 321. In an emergency, always dial 999.
Visit gov.uk/ACT for more information, including how to report extremist or terrorist content that is online.