“This case has caused damage so vast and so far-flung,” said Amy Sweasy, a prosecutor.

In the courthouse lobby, where several Somali-Americans waited to hear the judge’s decision, many saw the prison term as far too harsh. Some of them noted that white police officers in Minnesota and elsewhere had killed unarmed people and gone unpunished.

“It was fear, and it was quick, and you know, it was tragedy,” said Ifrah Mubarak, who was at the courthouse and said she was a friend of the Noor family. She said she believed Mr. Noor’s race and religion influenced his treatment by the court system.

In the few other recent cases where an American police officer has been convicted of murder, they have often avoided the harshest possible sentence. Jason Van Dyke, a white former Chicago officer convicted of second-degree murder and other crimes in the death of Laquan McDonald, a black teenager who was shot 16 times, was sentenced this year to just under seven years; prosecutors had called for at least 18 years. In Balch Springs, Tex., Roy D. Oliver II, a white officer convicted of murder in the death of Jordan Edwards, who was black and 15 years old, was sentenced last year to 15 years; the prosecution was seeking at least 60 years.

Dozens of people filed letters with the court seeking leniency from Judge Kathryn L. Quaintance for Mr. Noor. In court on Friday, Mr. Noor said he shot to defend his partner. But he acknowledged the pain he had caused Ms. Ruszczyk’s family.

“These are the people I worked to serve, and I harmed them,” said Mr. Noor, who had been in custody since the guilty verdict. “For that, I apologize.”

Mr. Noor asked Judge Quaintance for leniency. “I don’t want to lose my family,” he told her. But in denying the defense’s request for a lower sentence, the judge said the law did not allow for leniency because the defendant was a good person.

The shooting of Ms. Ruszczyk had been a mystery from the start — far different from police shootings that were recorded on cellphones or squad car dashboard cameras. There was no video or audio of what had happened.