CAMBRIDGE, MASS., OCT. 30 -- The judge who presided over the drug trial of D.C. Mayor Marion Barry and sentenced him to six months in prison said today he believes four jurors were determined to acquit Barry from the start and misled the court during jury selection about their objectivity.

U.S. District Judge Thomas Penfield Jackson, in his first public comments on the case since sentencing Barry last Friday on a misdemeanor cocaine possession charge, also said he is convinced Barry is guilty of perjury and other crimes and that he has "never seen a stronger government case." The judge spoke at a forum for students at Harvard Law School, from which he graduated in 1964.

It is unusual, but not necessarily improper, for judges to comment about their cases as long as the case is no longer pending, legal experts said yesterday. If the Barry conviction is overturned on appeal, Jackson would have to withdraw from any retrial because of his opinion about Barry's guilt, the experts said. His comments apparently do not supply Barry with ammunition in his expected appeal of his conviction, the specialists said.

Reached at his home after the address, Jackson said he thinks it is proper to make such remarks in an academic setting, and that it is important for future lawyers to understand how a judge makes rulings. He said he didn't expect his statements to have any significance if Barry wins on appeal. He declined to be quoted directly.

"I am not happy with the way the jury addressed the case," Jackson said at the forum. "Some people on the jury . . . had their own agendas. They would not convict under any circumstances." The judge said he believes four jurors were determined to acquit regardless of the facts. He said they "obviously did not tell the truth" during jury selection when questioned about possible bias.

Jackson said he thinks the jury could have acquitted Barry on two drug possession counts: one stemming from the FBI sting at the Vista Hotel; and another based on testimony from former city government employee Darrell Sabbs, who said he smoked cocaine with Barry but could not recall the year.

On all other counts, including perjury, Jackson said he thought the evidence was "overwhelming." The government, he said, "thoroughly impeached" the credibility of defense witnesses who attempted to provide Barry with alibis. Barry was convicted of one count of possession and acquitted on a second. The jury deadlocked on the other 12 charges.

"I am quite sure that neither race nor politics played any part" in the case, Jackson said, adding that prosecutors had a duty to investigate rumors of Barry's drug use.

In an hourlong question-and-answer session before about 150 people, Jackson talked about presiding in a spotlight, his views on race relations and his reasons for initially excluding Bishop George Augustus Stallings Jr. and Minister Louis Farrakhan, the Nation of Islam leader, from the courtroom.

He said that based on news accounts, he concluded both men are "outspoken racists."

"I would allow anybody {in the courtroom} who is not an outspoken racist, on either side," the judge said, adding that he would have excluded Ku Klux Klan members.

The judge said he was afraid that having Farrakhan and his bodyguards in the courtroom would signal the jury "that the whole trial is a racist plot and that we better hang together and protect one another."

Barry, Farrakhan and Stallings could not be reached for comment.

The Washington Post reported after the trial that the 12 jurors were almost evenly divided on most of the 14 counts against the mayor. In interviews, some jurors accused others of ignoring key evidence and considering factors that the judge had instructed them to disregard, such as whether race played a role in the investigation.

Johnnie Mae Hardeman, a juror who almost consistently voted to acquit Barry, said yesterday that she did not want to comment about Jackson's remarks, adding, "We did our duty."

Other jurors who voted consistently for acquittal could not be reached yesterday. In written questionnaires and in testimony during jury selection, several expressed reservations about the case against the mayor, and some said they thought race was a factor in the investigation. In one such case, Jackson refused prosecutors' request to excuse the juror because of bias.

Stephen Gillers, a New York University School of Law professor, said there is no prohibition against a judge talking about a completed case. But Gillers said "it might be imprudent" for Jackson to question the jury's work, saying to do so could impair future jurors' independence.

Jackson said his sentencing decision was influenced by his belief that Barry is guilty of crimes beyond drug possession. The judge said he accepted the jury's not-guilty verdict but felt free to draw his own conclusions about the counts on which jurors deadlocked. Under long-standing legal doctrine, sentencing judges can take into account such conclusions.

Jackson said he has "no doubt" that Barry lied to a grand jury investigating drug use.

Several students questioned the judge about the fairness of Barry's six-month prison term in relation to the sentence imposed on former White House adviser Michael Deaver, who was convicted on a felony perjury charge and sentenced by Jackson in 1987 to pay a $100,000 fine and perform 1,500 hours of community service.

The difference between the Deaver and Barry cases, Jackson said, is that Deaver "was not a high public official at the time he committed his crime," while Barry was the city's chief executive and a role model for youth.

Jackson said that although a verdict should not be influenced by a defendant's status, a sentence should reflect it. "To whom much is given, much is expected," the judge said.

Jackson repeated his statement at sentencing that Barry's drug use was "a breach of the public trust" that left him open to blackmail.

On the subject of Farrakhan, Jackson said he wanted to ensure that Farrakhan's security squad -- whom he described as "very well-dressed young men with walkie-talkies, who look like Secret Service men" -- did not sit in the front row and create an image of a "phalanx of force."

Jackson, appointed to the bench in 1982 by President Reagan, praised lawyers on both sides of the case, and added, "I am convinced as a lawyer and judge that we came about as close to perfect justice as humans can produce in a case such as this."

One question came from Andres Pastrana, a former mayor of Bogota, Colombia, who is a fellow at Harvard's Center for International Affairs. He asked whether Jackson had weighed his sentence's implications on cocaine-producing nations. Jackson said he did think about its impact on the global anti-drug effort. "That's part of the whole 'example' rationale," Jackson said.

Staff writers Tracy Thompson, Elsa Walsh and Michael York contributed to this report.