A teenage Muslim convert accused of planning to behead a British soldier claimed he knew one of Fusilier Lee Rigby's murderers, a court heard.

Brusthom Ziamani, 19, told a prison officer he delivered Islamic leaflets with the Woolwich soldier killer Michael Adebolajo in Greenwich Ziamani's trial was told.

Paul Morris, the prison officer who spoke to Ziamani at HMP Wandsworth while he was on remand last year, told the Old Bailey today the teenager made the admissions during a "welfare" chat while on remand.

Ziamani also told the officer he had been on his way to attack and behead a British soldier during the conversation, the court heard.

Jurors have previously heard Ziamani was arrested in an east London street last August while carrying a bag containing a hammer, knife and a black Islamic flag.

Giving evidence from behind a screen, Mr Morris told the jury that he had spoken one-to-one with Ziamani in his cell on August 28, before immediately going to make notes of what was said.

Mr Morris said: "He said he knew Michael Adebolajo. He said he loved him and he said he used to hand out leaflets in Greenwich with him as well. He said he had never met (the other Woolwich killer) Michael Adebowale."

He said that Ziamani has been "calm and polite", adding: "What concerned me was that first of all I was not sure if he was making some of it up. When he said he didn't know Adebowale I felt he was telling the truth - he was not trying to tell me he knew all these people. So for me I was believing what he was saying."

Mr Morris also described Ziamani telling him why he was in Wandsworth.

He told the jury: "He said that he had been arrested when he was on his way to an army barracks, he didn't say where. He said he was going to behead a British soldier and hold his head up in the air while a friend took a photo of him doing so.

"Again he was very, very calm and matter-of-fact."

Naeem Mian, defending Ziamani, said there was no dispute that the teenager had said he was on his way to behead a soldier, but suggested that it was said just in the context of explaining what the allegations against him were, rather than a confession.

Mr Morris replied: "That (a confession) is how I perceived it at the time. When I first asked him why he was here he could have said there and then."

He added that he had asked Ziamani what he was in for when he arrived and he had said it was for extremist posts on the internet.

Mr Morris said that Ziamani had also asked to be transferred to Belmarsh prison because there were "real brothers" there.

He also mentioned demonstrations he had taken part in and people he knew.

Mr Morris said: "He said he knew members of Al-Muhajiroun. That is the only group he discussed with me. He mentioned Mr Anjem Choudary."

However, Mr Morris accepted Mr Mian's suggestion that he did not know whether the claims were true or not and also confirmed that Ziamani had also told him that he was married with children, which was not true.

The jury yesterday heard that Ziamani, from Camberwel, idolised Adebolajo.

He is also alleged to have told an ex-girlfriend that Adebolajo was a "legend" and told her he would "kill soldiers".

The jury heard he also put posts on Facebook under the name Mujahid Karim supporting Sharia law and stating he was "willing to die in the cause of Allah".

Today the jury was read extracts from police interviews after a previous arrest in June last year over extremist posts he made online. In interviews Ziamani said he would "harm" Prime Minister David Cameron if he got the chance although the court heard nothing to suggest he had been planning to attack Mr Cameron.

He also told officers the Government and media had "overdramatised" Fusilier Rigby's death.

The court has previously heard he researched the location of army cadet bases in the south east of the capital.

In the interview read out today he told officers he had simply searched for them because he was "bored".

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