Gregory W. Wamsley, 25, of 6813 Garrett Rd., Derwood, a former guard at the Montgomery County Detention Center, was being held without bond yesterday on a charge that he killed a retired District police officer Tuesday night after a holdup at the victim's cleaning store.

Montgomery County police said the victim was Patrick J. O'Sullivan, 50, owner of the Nu-Look Cleaners at 7213 Muncaster Mill Rd., Derwood, who investigators said chased the man who had robbed him. They said O'Sullivan was not armed at the time.

Police also said that Wamsley had been convicted and sentenced last month to three years after pleading guilty to charges of selling marijuana to Detention Center inmates. He was free on bond pending incarceration in a federal prison, officers said.

O'Sullivan, an 11-year veteran of the District police force, handed over an undisclosed amount of cash to an armed bandit about 7 p.m. and followed what police said was a getaway car in his pickup truck. Investigators said the chase ended on a dead-end street, and that O'Sullivan was fatally shot when the occupant of the car walked to the truck and fired several shots.

Wamsley was arrested near Laytonsville by an off-duty Montgomery officer, who overheard a description of the suspect over his cruiser's radio. Police said a handgun and money were recovered.