A police operation which resulted in a terrorist being killed could not have been more effective given the circumstances, an inquest has heard.
Sudesh Amman, 20, was killed by armed surveillance officers after he stabbed two people on Streatham High Road, south London, on 2 February 2020.
The strategic firearms commander that day told Amman's inquest the tactics used against him were the correct ones.
"I don't see how we could have achieved a more effective result," he said.
The inquest at the Royal Courts of Justice was previously told there had been concerns about the 20-year-old's imminent release from HMP Belmarsh, which happened on 23 January 2020, part-way through a 40-month sentence for preparing and engaging in acts of terrorism. Jurors have also heard that both the police and MI5 decided against arresting Amman two days before the Streatham attack, in which a man and a woman were injured.
The superintendent responsible for the firearms strategy on the day Amman struck, known only as BX88 to protect his identity, told the inquest: "In the context of an armed operation, one person lost his life and others were injured.
"I have reflected a great deal and I have to say, I have been back through this in my mind from a personal perspective, I don't see how we could have achieved a more effective result with the circumstances presented to us.
"I know that sounds harsh because Amman lost his life. We were responding to his actions, and his actions were attempting to kill people."
The witness added: "I think the mitigation measures in place were incredibly successful to manage that risk. We don't work in a risk-free environment."
The inquest also heard that the operation's tactical firearms commander (TFC) had not been told Amman had left his probation hostel and been spotted carrying a white JD Sports bag shortly before the attack.
Jonathan Hough QC, counsel to the inquest, told jurors that logs from the day showed an officer tried to contact the TFC after the 20-year-old left his hostel, but could not get through so left a voicemail.
The commander, known as DS51, said she was likely to have been on a call to officers about an unrelated operation at the time but she "never had a missed call or a voicemail".
DS51 added that she was in "total disbelief" when she learnt what had happened to Amman.
"I was shocked that he had stabbed members of public and had subsequently been shot by police," she said.
Last week, the senior officer investigating Amman at the time of the attack denied suggestions from the lawyer of the 20-year-old's family that the undercover operation had been a "massive failure".
The officer, known as HA6, said: "The professionalism and the bravery of those officers and what they prevented... it could have been far, far worse."
While in prison Amman had apparently signalled his intent to strike once back in the community, the inquest jury has heard.
Police were so concerned about Amman's unrepentant behaviour in Belmarsh that they asked the prison governor not to release him. However, the request was turned down because the nature of Amman's conviction meant he was legally entitled to be released from prison.
The inquest continues.