A D.C. police officer was shot and critically wounded last night during an undercover narcotics operation in a notorious Northeast drug market, police said.

The officer, Herman J. Keels, 39, was shot once in the stomach with a handgun while making an undercover drug purchase as a part of the police department's Operation Clean Sweep program.

It was the first time an officer has been wounded during the city's year-old crackdown on street-level drug trafficking.

Also, it was the second time in three days that Keels was shot at during undercover drug operations. On Sunday night, as he arrested two men in the 3300 block of 14th Place SE, a gunman fired a bullet that ricocheted off his handcuffs and lodged in his pants pocket, police said.

Last night's shooting occurred about 8:30 p.m. in the 3500 block of Jay Street NE, in the Paradise Manor apartment complex, which is next to the Mayfair Mansion apartment buildings. Both have been beset with round-the-clock, open-air drug trading.

Keels, a 17-year member of the force who works in the morals division, was taken to D.C. General Hospital and immediately underwent surgery. A hospital spokesman said Keels was in surgery for more than two hours and and was in critical condition at 1 a.m.

Police officers backing up Keels said he had just made a drug purchase and identified himself as an officer when the drug seller produced a handgun and fired once.

The officers said they arrested a 17-year-old youth as he attempted to run from the scene. Police continued to look for suspects after the shooting, blocking off Jay Street at Kenilworth Avenue and searching every car, as well as two Metrobuses, that passed. The search, which lasted two hours, backed up traffic for a quarter-mile on Jay Street.

Also, police mounted an intensive search of the woods bordering the nearby Kenilworth Aquatic Gardens.

Police Chief Maurice T. Turner Jr. declined to reveal how many police officers support an officer involved in a Clean Sweep undercover narcotics operation. He called undercover narcotics work "the most dangerous job" in the department and said that drug suspects "are now becoming bold enough to shoot police officers."

The Mayfair-Paradise apartment complexes have become one of the city's most notorious drug markets and the focus of repeated Operation Clean Sweep raids, according to police.

The 672-unit Paradise Manor apartments sit on a 22-acre, horseshoe-shaped tract next to Kenilworth Avenue between Jay and Hayes streets NE, near the Kenilworth Aquatic Gardens. The Mayfair Mansions apartments are adjacent to Paradise Manor. Dozens of three-story brick buildings line the sprawling area, which has become the city's busiest, and one of the most violent, crack and cocaine markets.

At least six drug-related slayings have occurred in the area in the last year, and dozens of other shootings attributed to the drug markets have been reported.

In late August, police arrested 72 people and seized about $13,000 worth of illegal drugs in an 11-hour Operation Clean Sweep crackdown on the streets that border the apartment complexes.

In interviews last night, residents, who asked not to be identified for fear of retaliation, said drug problems had swamped the complexes.

One man said that he regularly patrolled the yard in front of his home with a fierce-looking German shepherd on a leash in a futile effort to clear the area of crack dealers.

"It's like going to the market and buying groceries," he said. "They're there all day and all night. I hear shootings every night." He said he had heard two shots earlier last night.

The Operation Clean Sweep program, created in August 1986 as part of a citywide assault on drug trafficking, has resulted in more than 20,000 arrests. In July, city officials held a news conference in a parking lot at the Mayfair-Paradise apartment complexes and announced that they would intensify police efforts to rid the area of drug dealers.