Mayor Marion Barry was sentenced Friday to six months in prison, fined $5,000 and given one year probation for his conviction on a misdemeanor cocaine possession charge.

Barry declared himself "truely remorseful" and asked U.S. District Judge Thomas Penfield Jackson for leniency. But Jackson told the mayor he had abused his office and the collective trust of the community."Having failed as the good example he might have been, the defendant must now become an example of another kind," Jackson said.

The sentencing ended a 10-month legal drama that began with the mayor's arrest Jan. 18 in an FBI sting operation that caught him on videotape smoking crack cocaine with a former girlfriend.

The night before sentencing Barry, in a letter to the judge, said he was a recovering alcoholic and drug addict. "I stand here truly remorseful and ask this court to impose community service," Barry told Jackson.

Barry said he was willing to "take full and personal responsibility for all my actions, all my attitudes."

But Jackson said Barry's position as mayor and "his breach of public trust alone warrants an enhanced sentence." The judge also said: "The public rumors of defendant's frequent and conspicuous drug use - never dispelled and now unfortunately shown to have been true - has given aid, comfort and encouragement to the drug culture at large and contributed to the anguish that illegal drugs have inflicted on this city in so many ways for so long."

Jackson also said he found evidence from

the trial that Barry had obstructed justice. However, the judge gave some weight to Barry's admission that he was an alcoholic and a cocaine user.

In issuing the sentence, Jackson forged a middle ground between the recommendations of prosecutors who urged that Barry be given the maximum one-year sentence and the defense. Jackson also ordered Barry to join a drug rehabilitation program while in prison and said the mayor will be subject to random drug testing during his year of probation.

Barry stood motionless at a lectern facing the judge. After Jackson pronounced the sentence, Barry's head sagged slightly but he appeared otherwise impassive.

The mayor, who is running for City Council, is eligible to appeal the sentence but neither he nor his attorney immediately said whether they would do so. His term as mayor expires in January.

Barry was convicted on Aug. 10 of a single cocaine possession charge and acquitted on another after a dramatic 10-week trial. The jury deadlocked on the remaining 12 counts, and prosecutors said they would not seek a new trial.

The judge made clear that he disagreed with the jury's failure to convict the mayor of the other charges. Jackson said he would ignore "what I perceive to have been the defendant's efforts to induce the jury to disregard the law and the evidence."

"The jurors will have to answer to themselves and to their fellow citizens for the way in which they discharged their duty," he said in a stinging criticism of the panel.

Barry's place of confinement has not yet been determined and will be assigned by the federal Bureau of Prisons.