The Justice Department has concluded that federal prosecutors here were justified in refusing to reveal the source of unsubstantiated allegations that a District of Columbia deputy police chief improperly ordered the release of two robbery suspects.

The Washington Metropolitan Police Officials Association had asked Attorney General William French Smith to force prosecutors to name the source of the allegations against Deputy Chief Alphonso D. Gibson, head of the department's criminal investigation division.

The allegations that Gibson had ordered the release of the two suspects because they were his relatives led to a month-long investigation of Gibson by prosecutors earlier this year. The investigation concluded he was not related to the robbery suspects and had done nothing wrong. Gibson, through the association, pressed prosecutors to reveal the name of his accuser.

But in a letter to Inspector Max Krupo, president of the association, Justice official Michael E. Shaheen wrote that the office of U.S. Attorney Stanley S. Harris was correct in withholding the name of the source.

Shaheen, head of the department's office of professional responsibility, wrote that "the entire matter appears to have been handled in a highly professional and discreet fashion."

He wrote that Harris, "like any other law enforcement agent," has an interest in making sure that sources feel free to tell prosecutors of possible criminal activity, and that often the only possible source of such allegations against an official is a subordinate. "Those persons must be encouraged to cooperate," Shaheen wrote.

Gibson had complained that a D.C. police officer had broken the law by knowingly making false allegations against him. But Shaheen wrote in his letter that rumors of Gibson's alleged involvement in the release of the robbery suspects had reached prosecutors before an officer reported them "in more concrete form," and that the officer appeared to have no ulterior motive.

Gibson, who could not be reached for comment yesterday, had contended that the allegations should have been looked into by internal police investigators, not prosecutors. But Shaheen wrote that the investigation by prosecutors was "consistent with existing policy . . . ."

Law enforcement sources have said the prosecutorial investigation was requested by Gibson's boss, Chief Maurice T. Turner Jr. But Turner, who declined either to confirm or deny initiating the investigation, defended Gibson's action last month, saying that "the only thing he did was review administratively" the release forms.

Harris declined to comment yesterday. Turner said he was satisfied that the investigation "was on the turf of the U.S. attorney's office" and that he has "no problem" with Justice procedures for investigating police officials, as outlined in Shaheen's letter.