Federal prosecutors may have to drop all pending drug cases that are based on evidence gathered by narcotics officers in D.C.'s 4th Police District -- at least 165 cases -- because they believe the cases are tainted by allegations that some officers kept drugs and money seized in raids, sources said last night.

"Serious consideration is being given to whether all the cases should be dropped for the sake of the integrity of the criminal justice system," a federal official said.

Sources said pending cases against alleged dealers brought by all 12 officers assigned to the vice unit would be affected by an ongoing FBI investigation of four or five 4th District narcotics officers alleged to have profited from drug raids.

That investigation has been expanded in recent days to include allegations that some 4th District narcotics officers took payoffs from drug dealers in exchange for information about Operation Caribbean Cruise, a much-vaunted drug sweep that resulted in an unexpectedly small number of arrests, sources said.

Federal agents visited the 4th District police station at 6001 Georgia Avenue NW Thursday, looking for records of the drug crackdown, sources said.

Officials believe that defense attorneys would be able to challenge all pending cases brought by 4th District vice officers by claiming that they may have known about the alleged skimming even if they did not take drugs or money themselves, according to sources.

If any of the cases are allowed to proceed, sources said, officials fear that the legal challenges could tie up for years the already overloaded D.C. Superior Court calendars.

It was not known last night how many cases might have to be dropped, although one source estimated that at least 150 cases in D.C. Superior Court and at least 15 in U.S. District Court might be dismissed. Sources said the actual number could be much higher because the 4th District brings a larger share of drug cases than the other six police districts.

It could not be determined what effect the investigation might have on appeals cases already tried involving 4th District vice officers. Except in extraordinary circumstances, defendants who plead guilty cannot appeal their convictions.

Last year, there were 4,537 felony drug cases in D.C. Superior Court and that number is expected to be much higher this year because of Operation Clean Sweep, the citywide drug crackdown. According to sources, 4th District officers have executed about one-third of all D.C. Superior Court and federal search warrants issued since January.

The FBI began a narrowly focused investigation into the alleged skimming some months ago with the secret cooperation of some D.C. police officers. The bureau did not inform police officials of the probe until Aug. 27, when The Washington Post disclosed the investigation in a news report.

The investigation focuses on Officer Shelton D. Roberts, his partner, Officer James Whitaker Jr., and several others, according to sources. Attempts to reach Roberts for comment have been unsuccessful. Whitaker, through his attorney, has denied any wrongdoing. Roberts is also a figure in the probe of Operation Caribbean Cruise, sources said.

Operation Caribbean Cruise was aimed at what was described as a heavily armed network of Jamaican drug dealers. Though 550 officers and support personnel fanned out over the city in a coordinated raid on Feb. 22, 1986, only 27 drug suspects were arrested and $20,000 worth of drugs seized.

After the raid, police officers told the department's Internal Affairs Division and Police Chief Maurice T. Turner Jr. that Roberts may have tipped off drug dealers, sources said.

The U.S. Park Police, which participated in Caribbean Cruise, also turned over information to the Internal Affairs Division about a stolen 4th District police radio that was allegedly provided to a raid target.

At a news conference on April 16, 1986, Mayor Marion Barry said that an internal police investigation had pinpointed the source of the leaks leading to the failure of the drug raid. But Barry said he and Turner decided not to make the findings public because to do so might jeopardize future secret operations.

Turner, in an interview last month, said the Internal Affairs Division had been unable to prove allegations of leaks to drug dealers. "We still have some aspects of that investigaiton that are currently being conducted and it wouldn't be fair of me to comment on those," Turner said then.

Officers also told Turner and the Internal Affairs Division that some 4th District officers were skimming drugs and money from drug raids, sources said.

When it appeared to the officers that the police chief and the internal affairs unit took no action on the allegations, the officers took the information to the FBI,sources said.

On Wednesday, police officials revoked the police powers of Roberts and Whitaker -- a disciplinary action one step short of suspension. The officers, both 17-year veterans of the police force, were given jobs in which they will not come in contact with the public, sources said.