A teenager accused of being inspired by the murder of Fusilier Lee Rigby to hatch his own a plot to behead a soldier cannot be convicted for having "repulsive" views, jurors have been told.

Brusthom Ziamani, 19, was arrested on a street in east London in August last year carrying a 12in (30cm) knife and a hammer in a rucksack, having earlier researched the location of Army cadet bases in the south east of the capital.

His Old Bailey trial has heard that he "reverted" to Islam early in 2014 and was arrested after he showed his ex-girlfriend weapons, described Fusilier Rigby's killer Michael Adebolajo as a "legend", and told her he would "kill soldiers".

But opening his defence, his lawyer, Naeem Mian, said there was "not a shed of evidence" that he had carried out any reconnaissance to kill a member of the armed forces and jurors should not judge him for having "offensive" opinions.

Mr Mian said: "It's not illegal to be offensive. In fact only recently we saw heads of state in Paris marching to defend the right to be offensive in the wake of that atrocity that happened there.

"Our Prime Minister went there and said it's quite right people have this right. We have this right in this country. That's the beauty of rights - they apply to all of us.

"We have the right to be offensive. We all have the right to have an interest in gore and grisly stuff. We have the right to have undoubtedly repulsive views, some of which he has expressed.

"He is not on trial for his views. He is on trial because the Crown bring a charge to say that he was going to behead a British soldier despite the fact there is not one shred of evidence to show he carried out a reconnaissance mission and, you bet, if there was, they would know. Quite easily done."

The lawyer added: "He is not on trial for the murder of Lee Rigby. He is not on trial for his opinions, as repulsive as you may find them."

He said Ziamani mainly expressed a preoccupation with getting a job and getting married, not to carry out "some sort of terrorist attack".

The defendant began his evidence by saying he was brought up in south London and went to school in Peckham.

He lived with his nursery nurse mother and psychiatric nurse father, who originally came from the Congo and were Jehovah's Witnesses.

He told jurors that he used to be involved in stealing people's credit cards and went to a "play house" to have sex with prostitutes.

He was drawn to become a Muslim from listening to rap music but concealed his conversion from his parents, he said.

He wore an Islamic robe every day but when he went home he would tuck it into his trousers, he said. He also hid a copy of the Koran in his wardrobe.

The defendant told the court that his parents only found out he was a Muslim when they saw pictures of friends in Islamic clothes on his mobile phone.

Ziamani, of Camberwell, south London, denies a charge of preparing an act of terrorism on or before August 20 last year.