On January 18, 1990, Barry was arrested with a former girlfriend, Hazel "Rasheeda" Moore, in a sting operation at the Vista Hotel by the FBI and D.C. Police for crack cocaine use and possession. The incident was widely broadcast on television, showing an enraged Barry excoriating Moore, who had become an FBI informant.
Barry was charged with three felony counts of perjury, 10 counts of misdemeanor drug possession, and one misdemeanor count of conspiracy to possess cocaine. The criminal trial ended in October 1990 with a conviction for only one possession incident, which had occurred in November 1989, and an acquittal on another. The jury hung on the remaining charges. Six or seven jurors (of whom two were white and the rest black) believed that the evidence against Barry was overwhelming and that he had displayed "arrogance" during the trial. Against these, five black jurors were convinced that the prosecution had falsified evidence and testimony as part of a racist conspiracy against Barry, and even disputed factual findings that had not been contested in court. After scolding the jurors for not following his instructions, the judge declared a mistrial on the remaining charges.
As a result of his arrest and the ensuing trial, Barry decided not to seek reelection as mayor. In the midst of his campaign for a city council seat, Barry was sentenced to a six-month federal prison term in October 1991.