CLEVELAND, Ohio — A federal appeals court ruled last week that the family of 15-year-old Brandon McCloud, whom Cleveland police detectives fatally shot in 2005, cannot sue the city or the officers for his death.

The 6th U.S. Circuit Court of Appeals asserted that the detectives, Philip Habeeb and John Kraynik, acted reasonably and believed the teenager posed a threat when they shot him 10 times while searching his home for evidence related to the armed robbery of a pizza delivery man.

The court ruled that the detectives and the city qualify for immunity under a statute that protects municipalities from civil prosecution and ordered U.S. District Judge Kate O'Malley to reverse her earlier ruling denying the detectives' motion for dismissal.

McCloud's family sued the detectives in 2006, saying that their reckless behavior and use of excessive force caused the teenager's death.

In asking O'Malley to dismiss the suit, Habeeb and Kraynik said they confronted a suspect who moved out of a closet suddenly in a small, dark bedroom with a knife in hand. They said McCloud, just seven feet away, presented a serious threat to their safety.

But O'Malley said in a 54-page ruling last year that McCloud was not charging the officers, since a mattress separated him from them, and that he wasn't waving the knife he held in his right hand in a threatening manner. The judge held that there was enough evidence that a jury could find the detectives used excessive force.

The appellate court rejected O'Malley's logic Friday, calling it "exactly the sort of theoretical speculation that the courts are prohibited from engaging in."