The sentencing of Mayor Marion Barry to a prison term for a misdemeanor drug offense could galvanize his electoral base for his D.C. Council campaign, but also may energize the anti-Barry voters who flexed their political muscle in last month's Democratic mayoral primary.

Although the political effect of U.S. District Judge Thomas Penfield Jackson's decision will not be realized fully until Election Day Nov. 6, several experts and veteran politicians said yesterday that the severity of the sentence could be a powerful rallying point for Barry in his bid for an at-large seat on the 13-member D.C. Council.

Barry, who since his January arrest often has attempted to turn his legal adversities to his political advantage, said yesterday he was "absolutely" committed to continuing his campaign.

"Why not?" he said as he left the District Building on his way to lunch with his mother, Mattie Cummings.

Anita Bonds, the mayor's longtime political strategist, said the six-month jail sentence could spark an outpouring of solidarity with Barry in the final phase of the campaign.

"What is available to the mayor is a pool of people" who are apt to view the sentence with anger and sadness, Bonds said. "We say to them, 'The place to be with him, especially now, is at the polls.' "

Surveys of District voters show consistently that Barry enjoys a firm base of support among at least 20 percent of the electorate, and that is a key component of the mayor's strategy in the eight-way race for two at-large council seats. The top two vote-getters in that election win the seats.

In an interview with Barbara Walters of ABC News last night, Barry said that the majority of voters recognize "my great accomplishment" and have forgiven him for his conduct and drug use that led to his arrest and conviction.

"I'm going to carry on my campaign, take our message of a voice and a vote to the people of Washington, and they have to {pass} a judgment on me. That's why I like democracy. It allows the voters to decide that -- not a judge, not the U.S. attorney, but the voters."

Ronald Walters, a Howard University political scientist, said yesterday that Barry supporters are likely to regard Jackson's six-month prison sentence as "an unfair verdict."

If Jackson had imposed a more lenient sentence, Barry "could well not have been elected," Walters added. "You could say that the judge, in his zeal to make an example of Barry, played a role in creating a black backlash" that could help Barry at the polls.

At the same time, Walters and other observers said voters in the areas where Barry is weakest politically -- notably the predominantly white wards of Northwest Washington -- could react with equally strong emotions when deciding the council elections.

Because the mayor's legal appeal will not be exhausted until sometime next year, after the new council is installed in January, the prison sentence could "draw a lot of people out to vote against him, thinking he could still win," Walters said.

"Most people who were anti-Barry to begin with would want to put another nail in the coffin," he said.

Jim Harvey, one of Barry's opponents in the council race, discounted the possibility of a decisive groundswell for the mayor in the aftermath of Jackson's sentence.

"Of course it will make some people angry, and if he continues to run they will come out and vote for him," Harvey said. "But those are few in number compared to those who hope instead that he sees this as a sign he should not continue in politics."

Incumbent at-large council member Hilda H.M. Mason, a D.C. Statehood Party leader who is widely believed to be most vulnerable with Barry in the race, said Jackson's sentence is "not a very harsh" one.

"I'm going to win," said Mason, who met briefly with Barry yesterday afternoon to tell him that she "loved and cared about him."

Linda W. Cropp, the Democratic Party nominee in the at-large race, said the sentence hurts Barry and the District.

"Whenever the mayor of a city is in the limelight as he has been, it impacts on the city and the citizens," Cropp said. "I think everything that happens today just brings back old wounds."

Cropp said she did not know how the prison sentence would affect Barry's candidacy, but she, like Harvey, renewed her call for the mayor to drop out of the campaign.

Barry, a lifelong Democrat who quit the party this summer to mount an independent bid for a council seat, has run a somewhat desultory race this fall, campaigning with far less money and enthusiasm than he mustered for his earlier efforts.

Some of his longtime supporters said yesterday that the current tone of Barry's campaign -- and voter response to his candidacy -- reflect the fatigue that some in the District feel after months of unrelenting publicity about his personal, political and legal troubles.

Some Barry supporters said they doubted that Jackson's sentence could overcome that sense of exhaustion among voters.

"A lot of people have affection for the mayor and what he did in office, but they weren't necessarily dissatisfied with the verdict" after Barry's ten-week trial, said one Democratic Party activist. "Those same people may not want him to run for office again."

D.C. Council member Charlene Drew Jarvis (D-Ward 4), a frequent political ally of Barry's, said that although the prison sentence may engender some sympathy for the mayor, many voters may be "so weary of this that they want it to be over, and they want to close the chapter with some certainty."

"It's going to take us a couple of days more to tell whether the first blush of surprise turns into sympathy for the mayor or it turns into a real desire to get this over with," Jarvis said.

Mark L. Plotkin, political editor of WAMU-FM and a frequent commentator on District politics, said the prison sentence might help Barry, but perhaps not enough to jump-start a "faltering, failing campaign."

"The sentence didn't change anybody's mind, but it might inspire people to vote who otherwise might not have voted," Plotkin said. "It's an X factor, and his campaign needed this."