Colleagues ran to help PC Palmer, 48, after his killer Khalid Masood was shot dead.
Masood had crashed his car and run into New Palace Yard, where PC Palmer was on duty, and stabbed him
Video of the stabbing was shown to the inquest and a “chilling” image showed Masood bearing down on the officer with a large knife in each hand.
Masood is seen standing over PC Palmer and stabs him by a wall.
Within seconds, a plain-clothes officer shot him dead.
Images captured on a mobile phone showed the frantic scenes as people rushed to offer first aid to PC Palmer.
The Old Bailey was played audio on which shouts of “police officer stabbed in the head, police officer stabbed in the head” can be heard.
PC Palmer was described as having a “weak pulse” and losing blood while someone else is heard saying: “He’s been stabbed in the back.”
The audio also picks up a man urging PC Palmer to fight for his life, shouting: “Keith, come on son.”
Just before 3pm an ambulance arrived at the scene but paramedics’ efforts to save the officer stopped at 3.15pm.
The “ferocious” attack occurred after Masood, 52, had mowed down and killed four pedestrians on Westminster Bridge on 22 March last year.
Witness Carl Knight, who was on a bus when Masood crashed into railings outside Westminster, said he heard a “loud bang” that sounded like a “small explosion” or a “backfiring car”.
He said he then saw Masood, who he described as an “African male”, get out of the driver’s side of the Hyundai.
In a statement, Mr Knight said: “A pedestrian male walked across and said, ‘What are you doing?’
“The African male replied, ‘f*** off, you don’t want to mess with me.'”
He said the threat was made “aggressively and dominantly” as Masood wielded knives in each hand.
Mr Knight said: “I could hear screaming coming from downstairs and women’s voices shouting, ‘drive’ and ‘let me off the bus.'”
He said people ran when they saw the knives, while one woman held her child and said: “Don’t kill me.”
Masood ignored the woman and began running in the direction of the Carriage Gates where PC Palmer was on duty.
Mr Knight said: “I’m not sure if he (PC Palmer) challenged the African male. I’m not sure exactly what they did. They were both grabbing each other and tumbling to the floor.
“The African male seemed to get the better of the officer.”
Mr Knight told the inquest how Masood began stabbing PC Palmer in the back and the blade appeared to be “bouncing off the officer’s jacket”.
He said PC Palmer was stabbed about five times before Masood was shot.
Witness James West said Masood was “stabbing downwards, like you see in a horror film … in a Hollywood stabbing motion”.
He said PC Palmer had managed to escape from underneath Masood.
Mr West said: “I remember being amazed because the officer managed to get up after being attacked, after being stabbed so many times.”
PC James Ross, who was on duty close to PC Palmer, said the first he knew of Masood’s rampage was when he heard a “loud bang” before a member of the public shouted in his face: “There’s a man with bloody big knives running this way.”
He then saw PC Palmer on his back, being attacked by Masood.
“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 said.
“He was hitting with such force that the blade was bending.”
PC Ross tried to get his CS spray out but when he looked back he could only see Masood.
He said: “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.”
Kurt Cochran, 54, Leslie Rhodes, 75, Aysha Frade, 44, and Andreea Cristea, 31, were also killed in the attack.