A Southeast Washington man has admitted taking part in last month's fatal shooting of 7-year-old Dennis Ashton Jr. outside a fast-food restaurant but said the gunfire was meant for someone else, a detective testified yesterday.

Bernard Thomas Coleman told police he never would have participated in the June 29 shooting had he known a child might be hit, homicide detective Jim King said during a hearing yesterday in D.C. Superior Court. The intended target -- a man identified in court only as "John" -- escaped unharmed.

Coleman, 21, is charged with first-degree murder in the killing, which took place in broad daylight in the parking lot of Popeye's Famous Fried Chicken, 4525 Benning Rd. SE. The youngster was shot in the head as he sat in the back seat of his father's car. "John" was sitting in the front passenger seat.

A second suspect, Charles Fantroy, 17, also of Southeast, faces identical charges and acknowledged firing the fatal gunshot, authorities said.

Coleman's attorney, Janet Hoeffel, asked that he be released from the D.C. jail and put in a halfway house while awaiting trial. But Judge Susan R. Winfield found him to be a danger to the community and kept him incarcerated.

"What could demonstrate dangerousness more than shooting into a car and not knowing who is inside other than the intended target?" Winfield asked. In drive-by shootings, "shots are fired. Innocent children, fathers, mothers and grandparents take bullets for intended targets. Even though he didn't intend to shoot a 7-year-old, he did the kind of things that let 7-year-olds die."

Coleman told police that "John" and two other men had shot him and Fantroy in April 1995 and that they wanted to avenge the shooting, King testified. But Fantroy has told police that John was an associate of people who shot him and not the shooter.

According to King, Coleman said he and Fantroy saw John sitting in a silver Ford Probe in Popeye's parking lot. Coleman told police he deliberately drove his car into the path of the car, giving Fantroy, who had a .44 caliber revolver on his lap, the opportunity to fire five quick shots. The Ford was driven by Dennis's father, Dennis Ashton Sr.

Investigators initially believed the elder Ashton was not telling them all that he knew about who might have killed his son. But Coleman, who was arrested July 3, told police that the elder Ashton only happened to be in the car at Popeye's and was not in any way the target of the shooting, King testified.

Coleman tried to blame other people for the shooting when he was first arrested, King said. He later admitted his role and said that he and Fantroy even burned the vehicle they were using and wiped off fingerprints to get rid of the evidence. Police recovered the car in an impound lot.

Assistant U.S. Attorney Teresa A. Howie did not reveal "John's" full name to the defense and declined to comment when asked about the earlier trouble.

Dennis's mother, Latonya Smith, attended yesterday's hearing with other relatives. She and Dennis Ashton Sr. broke up about five years ago, but she has said they remained friendly and that he spent a lot of time with his son, nicknamed Puff, who lived with Smith in Northeast Washington.

Fantroy, jailed since his arrest July 10, is scheduled to appear before Winfield Friday for a preliminary hearing. CAPTION: Bernard Thomas Coleman sits at table at hearing. Other participants are, from left, Judge Susan R. Winfield, defense attorney Janet Hoeffel and prosecutor Teresa A. Howie. Behind Howie is the victim's mother, Latonya Smith.