The man accused of killing Philadelphia Police Sgt. James O’Connor IV bragged of the shooting as he sat in jail and scrawled the officer’s name on the wall of his cell, along with the names of four other people he said he had killed, prosecutors said in court Tuesday.

Hassan Elliot etched O’Connor’s name in pencil inside his cell at Curran Fromhold Correctional Facility, prosecutors said during a preliminary hearing for Elliot and three others charged in the officer’s death. O’Connor was shot in March while serving arrest warrants for Elliot and another man in Frankford.

In court Tuesday, Assistant District Attorney Anthony Voci displayed a picture of the list of victims he said Elliot claimed to have killed. Elliot also passed incriminating notes to two of his friends who were locked up with him, Voci said. In one of the messages, later intercepted by police, he said Elliot bragged that he “let that Mossberg bang,” a seeming reference to a .22-caliber rifle used to shoot O’Connor.

Those revelations came at the start of a two-day hearing for Elliot and three other men charged in O’Connor’s death. The four made their first court appearances Tuesday, seven months to the day of the shooting. The group’s marathon preliminary hearing is scheduled to conclude Wednesday in front of Municipal Court Judge James M. DeLeon.

Elliot, 22; Khalif Sears, 19; Bilal Mitchell, 20; and Sherman Easterling, 25, all of Philadelphia, are accused in the shooting that took the life of O’Connor, a 23-year veteran of the force. He was the first Philadelphia police officer to die in the line of duty since 2015..

Tuesday’s proceedings were well-attended, even amid the coronavirus pandemic. O’Connor’s family sat in the courtroom, while a few dozen of his fellow officers watched from afar, wearing masks and spread out in another room.

O’Connor, 46, died at Temple University Hospital shortly after he was shot about 5:40 a.m. March 13. The city coroner ruled that O’Connor had been shot twice, once in the lower back and once in the left arm, and that the fatal bullet to his back had narrowly avoided the two ballistic vests he had been wearing, according to prosecutors.

Elliot has been charged with murder, seven counts of attempted murder for shooting at the officers who accompanied O’Connor, and related offenses.

He also has been charged with murder and gun charges in the case the SWAT officers were pursuing him for, the 2019 shooting death of Tyrone Tyree Jr., 33, in Frankford. And he faces attempted-murder and related charges in a December 2019 shooting in the same neighborhood.

Evidence taken from the jailhouse letters written about O’Connor’s death also led prosecutors to charge Elliot with murder in the 2018 shooting of Kaseem Rogers, a Frankford teen about to head to college.

The room Elliott and his alleged associates were holed up in on the morning of O’Connor’s death was small, cramped, and dirty, homicide detectives testified said Tuesday. Elliott, they said, stood directly behind the closed door before blasting through it with a series of bullets from the rifle as SWAT officers closed in on him.

The first officer who entered the home, Cypran Scott, said in court that he had loudly announced that police were there to serve a warrant, and the officers were fired on almost immediately as they climbed the stairs to the second floor. Evidence recovered at the scene indicated that 16 shots were fired at the officers, with one of the SWAT team members, Officer Patrick Saba, returning fire.

During the barrage of gunfire, O’Connor cried out that he had been hit, Scott said. From inside the room, voices called out to the cops to stop firing and that someone had been shot inside, according to Scott. All four suspects then left the room. Sears, Scott said, was limping from a gunshot wound to his leg.

Officer Brian Stark, a crime scene investigator, testified that nine handguns were later recovered from the small room. A Mossberg rifle with an obliterated serial number was also discovered, stuffed under the bed in the room and hidden by multiple pairs of sneakers. None of the handguns, all of which were fully loaded, had been fired, Stark said.

Both Elliot and Mitchell’s DNA was found on the rifle’s grip, according to forensic test results introduced in court.

Sears and Mitchell have also been charged with murder under the conspiracy act, and prosecutors say all three are part of “SG1700,” a violent street gang based in Frankford.

Sears was also allegedly involved in Tyree’s murder, and faces murder charges for that case. Mitchell, meanwhile, was found in possession of crack cocaine after being taken into custody for O’Connor’s death, police said, and he has three other open drug cases.

Easterling, who prosecutors believe was present when the shooting took place, faces gun offenses, as well as a probation violation from a 2016 case for being present in a room with guns and drugs. He had been released from that state prison sentence a few weeks before O’Connor’s murder.

The son of a city police officer, O’Connor is survived by his wife, Terri, and two children: James, an officer in the Sixth District, and Kelsey, who serves in the Air Force.