Philadelphia prosecutors say Hassan Elliott fired more than 20 shots from behind a closed door at a SWAT team trying to serve a warrant in Frankford on Friday, fatally striking Police Cpl. James O’Connor IV as he climbed the stairs to reach the second-floor apartment where Elliott — wanted in a murder a year earlier — had been staying.

District Attorney Larry Krasner and two homicide prosecutors, Anthony Voci and Joanne Pescatore, said in an interview in Krasner’s Center City office Tuesday that they planned to charge Elliott with murder and a host of related counts in the killing of O’Connor, the city’s first fatal police shooting in five years.

Three other men — Khalif Sears, 18; Bilal Mitchell, 19; and Sherman Easterling, 24 — were in the room with Elliott when he pulled the trigger, prosecutors said. Voci said an investigation into their respective roles was ongoing, with forensic analysis not yet complete on the 10 guns and eight cellphones found inside. Each remained in custody on other offenses.

The details offered by Krasner and his assistants provided a clearer picture of the investigation into O’Connor’s death. Still, Voci said that prosecutors are at “the beginning of the road” in their probe, and that although Elliott was the only person so far facing charges in O’Connor’s death, “nobody has been cleared. This investigation is not over.”

The room in which Elliott and his alleged associates were holed up was small, cramped, and dirty, law enforcement sources said, and Elliott allegedly stood directly behind the closed door before blasting through it with a series of bullets from a .22-caliber rifle as SWAT officers closed in on him around 5:50 a.m. Friday.

He had been wanted in connection with the slaying of Tyree Tyrone in Frankford, around the corner from where police went to search for him Friday.

After Elliott began firing at police, O’Connor was struck in an arm and left shoulder, police have said. Officer Patrick Saba then returned fire through the closed door, striking Sears and a man who was in a separate bedroom at the front of the apartment, police said.

O’Connor, 46, was taken to Temple University Hospital and declared dead at 6:09 a.m. A married father of two, he was a son and father of city police officers, and his daughter is in the Air Force.

The four men in the room, meanwhile, were taken into custody. Sears and the other wounded man — who has not been identified — were briefly hospitalized.

Elliott, 21, was initially charged with the March 2019 murder of Tyrone. Sears had been wanted in connection with the same killing and was arraigned Monday on murder charges for that crime. Both men are now behind bars, court records show.

Easterling was not legally permitted to be in a room full of guns due to a 2018 conviction for firearms crimes, Voci said, and was being held on a parole violation as the investigation continued.

Mitchell, meanwhile, allegedly was found possessing crack cocaine after being taken into custody. He was arraigned Sunday on two drug counts, and court records show that he was being held on $1 million bail.

Mitchell was already named in three open drug cases, according to court records, including two filed during two weeks last month.

Records show that he was arraigned on drug and firearms offenses on Feb. 6 and released after posting 10% of $25,000 bail a day later. On Feb. 19, he was arraigned on three more drug counts, but posted 10% of $20,000 bail and again was released.

Asked if prosecutors should have sought higher bail for Mitchell, who had been repeatedly arrested for similar crimes, Voci said he did not know what bail requests prosecutors had made. But he said: “My recollection is that those bail amounts were within the guidelines.”

Earlier this week, Krasner was criticized by two frequent foes — John McNesby, president of the police officers’ union, and U.S. Attorney William M. McSwain — for withdrawing a drug prosecution against Elliott last year.

The drug case was dropped on March 27, 2019, a day after Krasner’s office approved a murder warrant for Elliott for the killing of Tyrone.

The homicide warrant was far more significant than the drug case, Krasner said, adding that Elliott did not show up for the drug trial on March 27 anyway.

Krasner also said the drug prosecution — had his office not dropped it — likely would have failed for two reasons: The narcotics allegedly found on Elliott were seized “in clear violation of the Fourth Amendment,” and an officer involved in the case had “extreme credibility issues” — issues that Krasner said were discovered and later memorialized in writing by officials in McSwain’s office.

Krasner’s office said that federal prosecutors even referred the issue to his office for a possible perjury prosecution.

McSwain, in a statement Tuesday evening, maintained that Krasner should have been more aggressive about seeking to put Elliott behind bars both in the drug case and for earlier parole violations, saying: “Krasner’s radical decarceration policies led directly to the murder of Cpl. O’Connor.”

In defending his office’s decisions, Krasner called it “sad” that “there are people who want to capitalize on [O’Connor’s death] politically.”

“The story here is really about a good cop and a good man who died,” Krasner said.

Staff writer Jeremy Roebuck contributed to this article.