A terrorist wielding two foot-long knives could have been heading towards the Prime Minister’s office “looking for another victim” when he was shot dead, an inquest heard.

Khalid Masood, 52, repeatedly stabbed Pc Keith Palmer in New Palace Yard and appeared “animated and frenzied” as he lumbered over to the MPs’ entrance.

Witnesses described the horrific scenes at the Palace of Westminster before Masood was brought down by a plainclothes officer, who shot him three times.

Masood had crashed his hired 4×4 into railings and run into New Palace Yard where he stabbed Pc Palmer after he stumbled by a low wall.

Keith Palmer
Pc Keith Palmer was stabbed by Khalid Masood (Metropolitan Police/PA)

He stood over the officer, stabbing him before being distracted by another officer.

Mortally injured, Pc Palmer got back to his feet but collapsed again on the cobbles as he bled out from wounds to his head and back.

James West, who was inside Portcullis House, said Masood was “stabbing downwards, like you see in a horror film… in a Hollywood stabbing motion”.

“I remember being amazed because the officer managed to get up after being attacked, after being stabbed so many times.”

Carl Knight, who was on the top deck of a bus, heard the “load bang” as Masood crashed his Hyundai.

On being approached by a pedestrian, Masood said “f*** off, you don’t want to mess with me,” Mr Knight said in a statement.

A woman clutching a child said “Don’t kill me”, while the “aggressive” knifeman ran towards Carriage Gates, behind a screaming crowd of people.

Mr Knight told how Pc Palmer grappled with Masood before he was stabbed.

John Campbell said the attacker seemed “animated and frenzied” afterwards, adding: “He was looking for another victim.”

Pc James Ross, who was on duty close to Pc Palmer, said a passer-by shouted in his face: “There’s a man with bloody big knives running this way.

“I saw the suspect had a knife in each hand with blades around a foot long and he was stabbing Pc Palmer in and around the head area.

“He was hitting with such force that the blade was bending.”

Khalid Masood
Masood was shot by a plainclothes officer (Metropolitan Police/PA)

Pc Ross said he was trying to get his CS spray out and when he looked back he could only see Masood.

He went on: “The attacker was walking towards me. He had the knives in his hands. I had a moment at that time I have never been able to remember from when he was walking towards me. I still have no recollection of it.”

Referring to what he has since seen on CCTV footage, Pc Ross added: “I have run to the gate, then stopped, turned around, then (I was) running at the suspect with some kind of plan in my head to try and tackle him before he got anyone else.”

A lawyer for Pc Palmer’s widow suggested there was no sign on CCTV of armed officers close to Carriage Gates for 46 minutes before the attack.

Dominic Adamson said: “In terms of events on the day, do you recall when you last saw AFOs (authorised firearms officers) in the vicinity of the gates?”

Pc Ross, who used to be an armed officer in 2013, said: “No sir.”

He told the court armed officers used to be stationed at the heavy open gates but in 2017 they had a “roving patrol”.

Senior Parliamentary Assistant Antonia Kerridge said: “The policeman had collapsed and the attacker ran over to him and just stabbed him two or three or four times.”

Gareth Patterson QC, for families of some of the victims, said the attack came after Theresa May had finished Prime Minister’s Questions.

He asked: “If he had made it to the members’ entrance does it allow him access to the Chamber?”

Ms Kerridge said there was a network of corridors and rooms, but they would eventually lead there.

Mr Patterson continued: “We know there had been PMQs that day at 12pm and PMQs had finished by the time of this attack. Is that the entrance the PM leaves the courtyard and she would no doubt have an office in the building beyond that entrance?”

The witness said: “Presumably yes, along with other ministers who would work there.”

Frantic scenes of people rushing to offer first aid were captured on a mobile phone.

In audio played at the Old Bailey, there were shouts of: “Police officer stabbed in the head. Police officer stabbed in the head.”

He was described as having a “weak pulse” and losing blood while another person said: “He’s been stabbed in the back.”

A man could be heard urging Pc Palmer to fight for his life, shouting: “Keith, come on son.”

An ambulance arrived on the scene just before 3pm but efforts to save Pc Palmer’s life stopped at 3.15pm.

The attack on Pc Palmer came after Masood had mowed down and killed four pedestrians on Westminster Bridge.