Images of murdered soldier Lee Rigby and British Islamic State executioner Jihadi John were among extremist material found on a Tube station knife attacker's phone, a jury has heard.

Muhiddin Mire, 30, went on a rampage with the blade at Leytonstone Underground station on December 5 last year, cutting the throat of musician Lyle Zimmerman so that his windpipe was exposed, the Old Bailey heard.

Prosecutor Jonathan Rees QC said police found material linked to Islamic State on Mire's phone, as well as images including: "Fusilier Lee Rigby. He was the young soldier who was hacked to death and effectively beheaded in May 2013. Images of the man who became known as Jihadi John."

The prosecutor went on: "The contents of the defendant's phone, when looked at alongside what he said during the course of the incident ... provides an insight as to what motivated the defendant to do what he did and what he was seeking to do to Mr Zimmerman."

The musician suffered "a deep and ragged wound" to his neck, and his windpipe was exposed. There were three cuts - one 4.7in (12cm) long and two 2in (5cm) long.

As Mire was led away by police, he said: "This is for Syria, for my Muslim brothers," and explained that his actions were in response to the bombings of hospitals in the war-torn state, the jury was told.

Dramatic footage of officers firing Tasers at Mire three times before he was brought to the floor was shown to the court.

He said "Allahu Akbhar" (God is great) as he was hit by the stun guns.

Mire was filmed outside the station by a member of the public, Daniel Bielinski, who could be heard in a five-minute clip played in court screaming "Call for police" and trying to warn other passengers away as Mire returned inside, still clutching a knife.

Mr Rees told the jury the footage was "fairly dramatic stuff, as you will appreciate".

It showed Mire slowly walking after Polish Mr Bielinski, who continued filming him and asked in heated exchanges: "Why you attack me and my girlfriend?"

As Mire returned to the station, Mr Bielinski screamed: "Be careful, be careful. Knife blade. Call for police. Security."

Somali-born Mire, who came to Britain as a young boy, accepts that he used the knife, and the issue for the jury to decide is whether he intended to kill Mr Zimmerman.

Mire, of Sansom Road, Leytonstone, denies attempted murder but admits four counts of attempted wounding and an alternative count of wounding with intent to cause Mr Zimmerman grievous bodily harm.

Mr Zimmerman, who was 56 at the time, was on his way to a gig, c arrying a small amplifier and a mandolin and with an electric guitar strapped to his back, when he was attacked.

He said he was "shocked by something violent happening".

Giving evidence from behind a screen, he said: "I remember that I started to yell for help. I remember being forced down, but I don't remember whether I was punched or shoved."

He told the jury he got "into as near as a foetal position" as he could and tried to protect his head.

He said he was kicked around six times, and they were "very, very violent kicks".

As well as the neck injuries, the attack caused a fault in his vision, a cracked tooth and bruising to his face.

He told the jury: "At the time my subjective impression was that I was being attacked by a crazy person, a mentally unwell person."

This was because of the nature of the attack, that it was in public and that he could think of no reason why he would be a target, the jury heard.

Mr Zimmerman, who was helped by a doctor who happened to be in the station, added: "I feel I was very lucky with the junior doctor passing by and my medical care afterwards and I'm determined not to be... changed by it."

The jury was read a series of witness statements detailing the attack on Mr Zimmerman.

Louise McGuinness said: "He pulled the blade in and out across the throat but no cut was made and no blood appeared.

"I watched as he began to saw through the man's neck six or seven times. This time blood did come. I could literally hear the man's skin ripping open. Blood began to flow."

She said Mire pointed at her and told her "you're next" when she shouted "stop, you arsehole", but they were separated by the ticket barrier.

Catherine McEvoy said she saw Mire kicking Mr Zimmerman and feared he might die if the attack continued, "because he was putting so much effort into it".

She said Mire appeared "angry, aggressive and frenzied".

Her boyfriend Charles McCorkell said in his statement: "I thought, 'what the hell, that is way over the top'. The white guy was taking a right beating."

He said Mire's arm "went back and forth like he was punching at his neck".

Retired civil servant Salim Patel, who works in a kiosk at the station, said he called 999 when he saw Mire attack Mr Zimmerman.

His statement said: "I could see the black man go down and make a sawing motion with his right arm, holding some of the white man's clothes."

He told the 999 call operator: "Get an ambulance, he's killing him using his knife."

Junior doctor Matthew Smith, who gave evidence in person, was on his way home from work at Homerton University Hospital when he heard other passengers say someone had been stabbed and saw "the victim sitting propped up against the barriers in a pool of blood".

He felt the musician's neck wound "was life-threatening".

Dr Smith said that when Mire came back into the ticket hall, "I was really very scared".

He added: "I obviously feared for my own safety and wanted to run away... but I didn't want to leave Mr Zimmerman. So I asked him if he could stand up. He said, 'I think so'."

Dr Smith managed to get the musician, who was showing signs of shock, back up to the train platform where he continued to give him first aid.

Andrius Sabaliauskas said Mire told him "This is for my Syrian brothers, I'm going to spill your blood."

The passenger tried to distract the attacker by asking him: "What did the man do to you?"

Mire did not reply, but instead tried to slash him with the knife, the court heard.

Mr Sabaliauskas followed Mire along a subway out of the station, hoping to "jump him" as he was distracted confronting Mr Bielinski, but the attacker turned back.

Mire again lunged at him with the knife, and he defended himself from the blade using his rucksack.

Lift engineer David Pethers saw Mire lunging at Mr Sabaliauskas and shouted out to try to stop him, swinging his bag in an attempt to knock him to the ground.

Mire then lunged at him with the knife, cutting his neck.

"He said he was going to kill me and my parents," Mr Pethers told the court.

The trial continues