Friends and family attend a memorial service on July 10 for Howard University student Omar Sykes, who was fatally shot in an attempted robbery. (Jahi Chikwendiu/The Washington Post)

The 26-year-old Northeast man charged in the July killing of a Howard University student told police that he set out to rob the student and that the gun accidentally fired during a tussle, according to court papers.

In his first court appearance since his arrest Tuesday, Rasdavid Lagarde was ordered held in the D.C. jail until trial on a charge of first-degree murder while armed in the July 4 shooting of Omar Sykes, 22, a senior majoring in business marketing at Howard.

Lagarde told a detective that he was “drunk, down on his luck and broke” when he and a friend saw Sykes walking along Fairmont Street NW with a classmate late that night, court papers say. Lagarde, who had a .380 gun, said his friend suggested robbing the pair.

Lagarde told police that during the robbery attempt, he and Sykes wrestled for the gun and it went off, court papers say. Authorities said Sykes was shot once in the chest.

Lagarde told detectives that he sold the gun a few days later, police said in court papers. It has not been located.

In the early stages of the investigation, police questioned people who frequented the area near the shooting and identified a group that calls itself the “Hobart” or “HBT” gang, according to the court papers, apparently referring to a street in the area. The group, authorities say, was responsible for thefts and robberies in the area and had also targeted Howard students.

A detective eventually interviewed someone who said that Lagarde had admitted being involved in a robbery that went bad, court papers say. Lagarde had told that person that the gun went off unintentionally, striking Sykes, and that Lagarde had thought that the weapon’s safety was on.

During the robbery, Sykes’s friend was hit in the head with a handgun, court papers say. His wallet has not been found.

Halima Sykes Dumas, Sykes’s sister, said that although news about the arrest was a relief, it has forced still-grieving relatives to revisit the crime.

“It’s brought all this to the forefront of our minds again,” said Dumas, who is 29 and lives in Florida. “That’s the hard part. It’s really nice to see that the investigation was going on. They were doing everything to make sure that it was brought to justice. We’re really happy about that.”

Sykes was the leader of Howard’s chapter of Alpha Phi Omega, a coed service fraternity. Dumas said her brother was interested in music and wanted to go into the business side of the music industry.

During Lagarde’s hearing in D.C. Superior Court, his attorney, Madalyn Harvey of the District’s Public Defender Service, questioned the credibility of the initial witness who identified Lagarde as the shooter. Harvey told the judge that the witness may have lied to get the $25,000 reward the city offered for the arrest and conviction of Sykes’s killer.

D.C. Magistrate Judge Karen Howze, who said Lagarde has convictions in Texas for burglary and other “violent crimes,” remanded him to jail until a Nov. 13 hearing.

On Tuesday, Lagarde’s mother said that her son had recently returned to Washington after attending auto-mechanic school in Texas to learn how to repair high-­ performance cars. He lost a job and became homeless, she said, and returned to the District.

At the hearing, Lagarde’s mother and other family members filled a row in the courtroom. They declined to comment, but one man shouted “Love you, bro” before he left the courtroom.

Lagarde, whose wrists and ankles were shackled, nodded his head.