Jesse L. Jackson yesterday criticized a U.S. district judge for barring Nation of Islam leader Louis Farrakhan and Imani Temple Bishop George Augustus Stallings Jr. from the drug and perjury trial of D.C. Mayor Marion Barry last week.

"It seems to be unconstitutional," Jackson said yesterday in an impromptu appearance outside Metropolitan Baptist Church on R Street NW. "I resent the idea that any citizen is denied his basic rights. If there had been a disruption, that would be one thing."

At about the same time, Barry and his wife, Effi, received a rousing welcome yesterday from about 1,000 congregants at the Imani Temple, the latest in a series of enthusiastic receptions for the mayor at appearances in the past six days.

Jackson's comments follow complaints by Farrakhan and Stallings about their treatment by Judge Thomas Penfield Jackson and an announcement by leaders of the American Civil Liberties Union, who said Friday that they would file an appeal of the judge's ruling.

In open court but out of the jury's presence, the judge said he did not allow the two men in because their presence would be "potentially disruptive, very likely intimidating." Stallings and Farrakhan are religious leaders who have espoused black separatist views.

Judges are ordinarily granted wide latitude to bar someone they conclude might disrupt a proceeding.

Jesse Jackson said he has not yet decided whether he will try to enter the courtroom to watch Barry's trial, and said he does not know whether his name "is on the judge's short list of people he is denying access to the courtroom."

Across town, Barry and his wife, Effi, joined Stallings to celebrate the first anniversary of his breakaway African-American Catholic congregation.

As the couple entered the Friendship Educational Center in Southeast Washington, the congregants who packed the auditorium gave them a standing ovation. While the choir sang "That's What Friends Are For," the crowd cheered wildly and the Barrys embraced Stallings on stage.

"We love you, Mayor Barry," Stallings said. "You're the greatest mayor this city has ever had. You're more popular now than ever before."

Barry's visit to the service was the latest of several high-visibility appearances, which some advisers said are designed to show continued public support during his trial.

Early last week Barry made a surprise appearance at South African black leader Nelson Mandela's address at the D.C. Convention Center, where the audience gave him a sustained ovation. The next two nights, he returned to the Convention Center for appearances with Farrakhan, where the crowds again greeted Barry with wild cheers.

Barry did not address the crowds at any of those appearances or at the Imani service yesterday.

During his remarks yesterday, Stallings said Barry was "in trouble right now because he is too smart, too intelligent and too black."

Stallings also spoke warmly about the mayor's wife. "When I get married I'm going to find me a woman just like Effi Barry," he said. "Talk about someone who stands by her man." The congregants, many dressed in colorful African prints or wearing kente cloth scarves around their necks, roared their approval.

Stallings sharply criticized Judge Jackson's refusal to allow him to attend Barry's trial on Friday, saying the judge wanted only acquiescent blacks and he was not one.

At the service, Barry and his wife clapped their hands and sang along with the resounding spirituals performed by the Imani choir. As dozens of congregants came forward to receive communion, several paused to greet the mayor and his wife.

Barry signed autographs for elderly women, and embraced and kissed several youngsters who approached him. He and Effi Barry then lined up to accept the wafers and wine, to murmurs of approval from the congregation, which has a policy of open communion.

Barry spent the morning at Metropolitan Baptist Church, which he recently joined. The news media was not permitted inside during his visit. After Barry left for the Imani Temple, Jesse Jackson arrived.

Jackson likened the government's investigation of Barry to Soviet police surveillance and past federal probes of the Rev. Martin Luther King Jr., Walter E. Fauntroy and New York Mayor David Dinkins.

"They went beyond their bounds," Jackson said of the sting operation at the Vista Hotel, where the mayor was arrested on cocaine charges. "They hired a woman, they bought drugs and they rented a room . . . . They spent so much money in pursuit of a user" rather than focusing their efforts on drug dealers.

Jackson, who on Barry's behalf earlier sought a plea bargain agreement, said the videotape of Barry smoking crack at the Vista Hotel has caused "immense hurt for the mayor, his wife, his child, his mother and his friends," adding that the community is "threatened by what the government has done."