As a smiling Marion Barry watched, Nation of Islam leader Louis Farrakhan urged the embattled D.C. mayor last night to seek reelection to a fourth term in office, calling him a "repentant soul" who is "under attack."

Farrakhan issued his call in an address before about 17,000 people at the Washington Convention Center, a gathering that brought together black business leaders, clerics and politicians. Among those on stage with Farrakhan were Barry, his wife, Effi, Bishop George Augustus Stallings Jr. and D.C. Council member Harry Thomas Sr. (D-Ward 5).

Farrakhan's speech, which was frequently interrupted by cheers and standing ovations, was much like others in which he has espoused black nationalism.

But last night's gathering had added political overtones. For the first time in its 60-year history, the Nation of Islam is fielding candidates for political office, and Farrakhan urged blacks to support three Muslims seeking election in the District and Maryland.

Minutes before Farrakhan appeared at 8:30 p.m., Barry and his wife made a surprise appearance and took seats on stage. When Farrakhan walked on stage, Barry stepped forward and the two embraced. The audience cheered wildly.

Barry did not address the gathering. Farrakhan, who termed the mayor "a repentant soul," talked on his behalf.

"I don't want the mayor to stop," Farrakhan said to the wildly applauding crowd. "I want the mayor to run, Barry, run."

In the most extensive public remarks to date about Barry, who is on trial for cocaine possession and perjury charges, Farrakhan characterized the mayor as a victim, one of many blacks he said were ensnared in a national campaign to "harass" black elected officials.

Last night, Farrakhan acknowledged that Barry had made mistakes, but said the mayor has done no more wrong than many white politicians, including President Kennedy.

Then Farrakhan asked a rhetorical question that elicited more cheers from the audience: "Is his prosecutor sinless? Is the attorney general sinless? Is President Bush sinless? Well, then. What are we talking about?"

Farrakhan sought to distinguish between the wrongs committed by Barry and those of elected officials who betray the public trust.

"If a man chooses to smoke or drink or use drugs, he sins against himself. Which is the greater sin, to abuse yourself or to abuse the public trust?" he asked.

Farrakhan said Barry "deserves our forgiveness," adding, "We stand with those who stand with us."

The Muslim leader's supportive stance toward Barry was an apparent switch from last month, when he launched a scathing attack on black elected officials.

Addressing a crowd of several hundred people gathered at the Mayfair Mansions apartment complex in Northeast Washington in May, Farrakhan characterized some black leaders as morally corrupt and asserted that they need to be replaced by Muslims.

Although he mentioned no one by name, Farrakhan said several times that the District lacks moral leadership, an issue that has been much discussed since Barry's Jan. 18 arrest at the Vista Hotel on charges of smoking crack.

The arrest occurred at the room of Hazel Diane "Rasheeda" Moore, a former Barry girlfriend who was used by the FBI in the sting.

Farrakhan has said of the Muslim candidates: "You can't offer them a strange woman because they have their wives. There is not going to be any back-room smoking and drinking. And you can't serve them any drugs."

Although Farrakhan devoted considerable time last night to Barry, the primary purpose of the rally -- another of which will be held tonight -- was to bolster the campaigns of the three Muslim candidates seeking offices, whom Farrakhan said "will not bow to the powers that be."

The Muslims have espoused political and economic separatism for blacks in America. Farrakhan indicated in his remarks that their platforms will reflect their national views.

One candidate, Abdul Alim Muhammad, Farrakhan's national spokesman, is a candidate for the 5th Congressional District seat held by Democrat Steny Hoyer of Prince George's County. Another candidate, George X Cure, a lawyer, is vying for the D.C. delegate seat in Congress being vacated by Walter E. Fauntroy (D), who is running for mayor. The third, Shawn X Brakeen, a schoolteacher, is running as an at-large candidate in the D.C. school board race.

The Muslims also used the occasion to conduct a voter registration drive and solicit donations and volunteer help for the campaigns.

The potential of the event was not lost on other politicial candidates, some of whom stood in the Convention Center lobby asking people to sign campaign petitions and distributing campaign literature.