Image copyright PA Image caption MP Tobias Ellwood rushed to the aid of PC Keith Palmer after the attack

An MP who fought to save the life of PC Keith Palmer during last year's Westminster terror attack has told an inquest how a doctor ordered him to stop giving CPR.

Tobias Ellwood rushed to help PC Palmer after he was stabbed by Khalid Masood on 22 March.

But a doctor told Mr Ellwood, "you've done your best", and PC Palmer died.

After almost breaking down in court, the MP said: "[We] closed the eyes and then I said 'I'm sorry'."

Mr Ellwood said that if he had taken his normal route into Parliament, he would have been closer to Masood as he launched the attack.

"I know I would have stepped forward and I regret not having the opportunity to do so," he added.

Four other people died after Masood drove into them on Westminster Bridge.

The inquest into the deaths of PC Palmer, 48, Kurt Cochran, 54, Leslie Rhodes, 75, Aysha Frade, 44, and Andreea Cristea, 31, is taking place at the Old Bailey in London.

An inquest into the death of Masood - who was shot dead by armed officers during the attack - will take place afterwards.

Mr Ellwood - Conservative MP for Bournemouth East and a medically trained former Army officer - told the court he was in a meeting close by when the attack occurred.

He said he heard a crash followed by screams, adding: "These were not screams of pain... these were screams of shock."

After running through crowds of people with "panic in their eyes" and hearing shots fired, Mr Ellwood said he saw a number of police officers crouched near Carriage Gate - which leads to New Palace Yard, outside the Houses of Parliament - and PC Palmer and Masood on the floor.

He said the three officers helping PC Palmer looked like they needed assistance, so he ran towards them.

They told him he was risking his life because of the chance of a secondary attack, but the MP - whose brother died in the Bali attack in 2002 - told the court: "My brother was killed in a secondary attack... so I was very aware of that.

"I was concerned about what would happen if things were to ratchet up, but my immediate concern was that we had somebody who was clearly badly bleeding and needed assistance."

Image caption PC Keith Palmer was pronounced dead at 15:15 on the day of the attack

Mr Ellwood said PC Palmer was unconscious, but that he still had a pulse, telling the court: "I was encouraged that we'd arrived on the scene early enough to do something."

But PC Palmer's heart stopped, and Mr Ellwood had to begin chest compressions while someone else gave the officer mouth-to-mouth.

"By this time the whole of Westminster was very silent," he said.

A medical team arrived by helicopter and moved PC Palmer so they could operate on him in the courtyard.

Mr Ellwood had to pause in the witness box, before saying: "Forgive me, it's sometimes easier to do the helping rather than to talk about it afterwards."

'I'm sorry'

Despite their efforts, the doctor said there was nothing more they could do.

Mr Ellwood said: "I told a doctor present 'you're going to have to order me to stop', and the medic said, 'Sir, you've done your best, but you do need to stop'.

"We both covered the body as best we could, closed the eyes and I said: 'I'm sorry.'

"It was a very strange end to a very traumatic four or five minutes, to suddenly be left completely alone with just one other person."

Dr Antony Hudson from London's Helicopter Emergency Medical Service, who performed the surgery on PC Palmer, told the court it would have been "nearly impossible to return a cardiac output" to a patient in that condition.

'Calm and measured'

By Helena Lee, BBC News correspondent, at the Old Bailey

Image copyright PA

Tobias Ellwood came to Court One at the Old Bailey today to give evidence - not as an MP, but as a man who tried to help save the life of a dying police officer.

He stood in the witness box for nearly an hour, at times with his hands gripped onto the oak-panelled sides.

His voice, calm and measured, set against the "screams of shock" and "panic in peoples eyes" which he described.

He paused every so often as the memories of that day came back.

As he began describing the surgery carried out on PC Palmer on the ground, he stopped talking and stayed silent for some seconds.

When Mr Ellwood finished his evidence, the barrister for PC Palmer's widow thanked him for his efforts to help the officer.

Despite his harrowing experience, Mr Ellwood called on other members of the public to "step forward" in the face of terrorist incidents.

He told the court: "I know the official advice is to step back, report it.

"[But] I find myself countering that somewhat, because if more of us do step forward as we saw in the Manchester attack - London Bridge and Westminster Bridge as well - the message gets through that no terrorist is going to win."

Asked by the lawyer representing PC Palmer's widow, Michelle, about security in Westminster, Mr Ellwood said there had always been a "sense of vulnerability" around the Houses of Parliament and that, at times, there had been less firearms protection at the site than he would have liked.

But he did not want it to become "a tower of protection", as it would "change the face of what Parliament is about".

The MP added: "[With] the level of security we have in place [now], I'm not sure we could do more."