A teenage British convert to Islam who said he wanted to decapitate a soldier has been convicted of terrorism.

A jury at London's Central Criminal Court found 19-year-old Brusthom Ziamani guilty Thursday of preparing an act of terrorism.

Prosecutors said Ziamani was inspired by the two Islamic extremists who murdered soldier Lee Rigby in a London street in 2013.

They said he researched the location of army cadet bases in London and told his girlfriend he planned to "kill soldiers" before he was arrested in August with a 12-inch (30-centimeter) knife and a hammer in his backpack.

Ziamani also posted comments on Facebook saying he was "willing to die in the cause of Allah" and calling for Islamic Sharia law.

He will be sentenced later.