The four-year-old daughter of a man shot dead in a Metropolitan Police firearms operation has failed in her High Court bid to prevent the officer who managed the operation from resigning from the force.
The ruling means "officer FE16" will not have to face possible disciplinary proceedings.
The court heard he is due to resign at midnight and take up a new career as an adviser to a television production company.
The 52-year-old has an unblemished police record of more than 30 years.
He was the tactical commander for the police operation in which Jermaine Baker was killed by a single gunshot by a marksman - not FE16 - on December 11 2015 during an alleged attempt to spring two Turkish criminals from Wood Green Crown Court.
The dead man's daughter, "AB", launched her unprecedented legal action to stop his retirement through her mother acting as "litigation friend".
Her lawyers urged that he should be suspended from duty, which would have meant he would still have been liable to face disciplinary action.
Mr Justice Mitting, sitting in London, said there was a prospect of the officer facing misconduct charges.
But the judge ruled the likely benefit to Mr Baker's family if those proceedings went ahead was "not great" and was outweighed by the "serious interference" they would cause to the officer's right "to conduct his life as he wishes".
The judge stressed there was no suggestion that FE16 was resigning to avoid disciplinary action.
Deborah Coles, director of Inquest, said: "We find the decision to allow a police officer to retire whilst under Independent Police Complaints Commission (IPCC) investigation into the fatal shooting of a young man indefensible.
"This can only undermine family and public confidence in the investigation process.
"All police shootings must be subject to rigorous and exhaustive investigation and every individual police officer involved should be held accountable for their actions until the investigation concludes."
Mr Baker's family was seeking a court order to stop FE16 resigning to give them time to seek judicial review of a Met deputy assistant commissioner's decision not to suspend him from duty.
A suspension would have meant he remained liable to possible disciplinary proceedings.
The judge said the allegation against FE16 concerned a briefing which "may not have given an entirely accurate picture" over whether the occupants in the car in which Mr Baker died were "in possession of an actual firearm".
The Met firearms officer who fired the fatal shot is currently under criminal caution with decisions pending on whether he will face a criminal trial. There is no possibility of FE16 facing trial, said the judge.