A former D.C. corrections officer who was critically wounded early Monday when he exchanged gunfire with two Prince George's County police officers may have been shot as he was trying to break up a drug deal outside his home, police officials said yesterday.

Police said the man, Raymond Zachary Simpson, 38, may have mistaken the two officers for drug dealers who allegedly had been seen selling crack near his home in the Andrews Manor apartments in Camp Springs, a few blocks from Andrews Air Force Base.

But investigators said they aren't sure why Simpson allegedly fired at least three shots at the two officers, who told officials they ordered Simpson to drop his weapon. Authorities said the officers returned fire, striking Simpson in the head and in the foot.

"More and more, it looks like he was a good guy who was trying to do the right thing but in the wrong way," police spokesman Royce D. Holloway said.

Police said the incident illustrates the dangers of residents trying to fight criminals. "Certainly, we want the community's help," Holloway said. "But let the police do the police work."

Simpson, of the 5400 block of Morris Drive, was listed in critical condition yesterday at Prince George's Hospital Center, where he was on life support, police said.

Simpson worked for the D.C. Department of Corrections for 11 years and was assigned to the Youth Center Facility in Lorton before he resigned in June. District officials have not disclosed any information about his resignation.

Neighbors said Simpson moved to a second-floor Andrews Manor apartment from District Heights earlier this year after separating from his wife.

A former neighbor of Simpson's told police yesterday that he sometimes waved a gun to chase drug dealers from a park near his District Heights town house. Simpson apparently was concerned for the safety of children who played in the park, but some residents said he was too aggressive, police said.

"The guy is a very zealous person," said Maj. Gerald Wilson, commander of the county police district that includes Camp Springs. "I've been told that he is the type of person who if he sees something in the community, he's not going to turn the other cheek."

Police said two uniformed officers on foot patrol encountered Simpson about 4 a.m. Monday and ordered him to drop to the ground after they saw that he was carrying a handgun. Instead, Simpson raised his gun and fired at least three shots at the officers, police said.

The two officers then fired a total of 10 to 12 rounds with their Beretta 9 mm service weapons, police said. Police said they recovered a .45-caliber semiautomatic handgun at the scene.

Police officials identified the two officers yesterday as Joseph Tapp, who was been with the department for two years, and Darren Butler, who has been on the force for one year. Neither officer was injured. Both were placed on administrative leave pending an investigation.

Earlier, investigators had thought there might be a connection between the shooting and an attempted armed robbery that was reported by two men who were outside the same apartment building moments earlier.

But police said yesterday that one of the men who had reported being robbed has recanted and told police that he was in the area to buy crack cocaine.

Investigators said they believe that Simpson may have rushed out of his apartment after he saw the drug deal unfold and then ran into the officers who were making their regular rounds at the apartment complex.

Staff writer Cindy Loose and staff researcher Bobbye Pratt contributed to this report.