An 18-year-old man charged in a recent armed robbery of a woman in a car on Capitol Hill was identified at a lineup yesterday in connection with 12 similar incidents, some involving sexual attacks, D.C. police said.

Police said the man was arrested June 4 by members of a special unit set up to investigate a series of robberies and sexual assaults that police believed had been committed by one person.

After yesterday's lineup, the suspect was ordered held in preventive detention by a Superior Court judge, and authorities said evidence in the 12 cases will be presented to a grand jury.

The man was arrested in connection with an incident that occurred about 6:10 p.m. May 22, when a gunman forced his way into a car occupied by two women and a 3-year-old girl at 3rd and G streets SE.

After taking rings, a watch and money, the gunman ordered the driver to drive off. A short distance away, she spotted a police cruiser and tried to ram it. Although she failed, the attempt touched off a police chase, which ended when the gunman jumped from the car and tried to fire two shots at Officer Walter R. Rau, police said. The gun misfired, but the man escaped.

Nevertheless, police said, Rau saw the gunman clearly enough to give new impetus to the investigation of a series of similar attacks in which the assailant forced his way into women's autos on Capitol Hill, ordered them to drive on and then robbed and sometimes raped them.

Police said that after further investigation involving questioning of neighborhood residents and the examination of photographs of suspects in other offenses, the 18-year-old was arrested and charged with armed robbery in the May 22 incident.

After his house was searched by officers with a warrant, police said, he was presented yesterday at a lineup before victims or witnesses to similar crimes. They said the investigation is continuing.

Meanwhile, in an unrelated case, a 27-year-old Washington man who pleaded guilty to two rapes and a burglary charge in connection with assaults committed in Georgetown in 1976 was sentenced to four years in prison followed by five years on probation.

Dennis D. McCants was sentenced to concurrent terms of six to 30 years on each of the charges, with all but four years of the prison terms suspended, according to court records.

Superior Court Judge H. Carl Moultrie I ordered McCants to undergo psychiatric treatment during the probation period and ordered periodic reports on his condition.

As part of a plea agreement with McCants, the government agreed to dismiss three additional rape charges, according to Assistant U.S. Attorney Timothy J. Reardon III.