After 11 days of confusion and doubt, D.C. City Council member Marion Barry emerged the victor last night in the Democratic mayoral primary as a near-final count in the election gave him an irreversible lead over City Council Chairman Sterling Tucker.

With all but a few hundred ballots to be counted from the Sept. 12 primary, an unofficial tabulation of votes for Barry, Tucker and incumbent Mayor Walter E. Washington showed these results:

Barry 32,708

Tucker 31,208

Washington 29,807

Officials at the D.C. Board of Elections and Ethics estimated that only about 100 to 150 miscellaneous ballots remain to be counted - far fewer than Barry's 1,500-vote lead over Tucker.

Barry could not be reached for comment late yesterday, nor could Washington. Tucker declined to comment immediately, saying he wanted more details from his campaign observers in the ballot-counting room in the District Building.

Even as weary elections board employes sighed with relief as the counting neared an end, Tucker campaign workers kept up a drumfire of protest and complaints.

Tucker's campaign manager Gerald Wallette charged that some 50 instances of suspected double voting discovered by elections officials may be "only the tip of an iceberg."

He asked elections board general counsel Winfred Mundle to turn over the suspected ballots and related voter records to the U.S. attorney's office immediately.

On Friday, Tucker lambasted the election as a "farce," citing numerous delays, snafus and irregularities including the apparent double voting. He said he planned to seek a court injunction to set aside the election and order a new one.

Barry's victory comes after a long and spirited campaign in the second mayoral primary election held since Congress granted the city limited home rule in 1974.

He trailed both Tucker and Washington in polls throughout the year and surprised many observers with his strong showing on election day, especially in predominantly white Ward 3, where he captured almost 48 percent of the Democratic vote.

Once the head of the youth self-help organization called Pride Inc., where he earned a reputation as a black militant, Barry toppled the venerable Walter Washington, who has been either the appointed or elected mayor of the city for 11 years.

With only a handful of questionable ballots, including those used by suspected double voters, to be examined by the three-member elections board, elections administrator Mary Rodgers said yesterday she hopes to have the election results officially certified by Wednesday.

At the same time, Mundle probably will be in court fighting Tucker's injunction request and a similar request by Robert Artisst, challenger in the closely contested Ward 5 City Council race against incumbent William Spaulding.

In both cases, Mundle says, he will argue that District law requires that any attempts to set aside elections be made only after the election has been certified by the board.

Preliminary tabulations in both the Spaulding-Artisst race in Ward 5 and a similarly close contest in Ward 6 between council member Nadine Winter and challenger Patricia Press showed both incumbents leading by small margins.

Mundle acknowledged yesterday that the board uncovered 59 instances of "suspected double voting" but disputed Wallette's suggestion that they may be only the "tip of an iceberg." He said a careful check of all 2,000 absentee and challenged ballots - where double voting is most likely to occur - turned up only the 59.

Precinct records showed, he said that 59 people who had cast challenged ballots - challenged for reasons such as not being registered in the precinct where they were attempting to vote - had also cast a "regular" or unchallenged ballot elsewhere.

Mundle said it is possible but not likely that some voters have deliberately registered two or more times in different precincts. Purging double or duplicate registrations from the voter rolls is a continuous process, he said, but is not always up to date.

Many double registrations are "innocent" or inadvertent, he said. They occur, he said, when residents move from one precinct to another, reregister, and the elections board falls behind in its efforts to purge the old registrations.

Yesterday's ballot counting involved the last of some 7,000 ballots that the board discovered on Thursday had been "unread" by the city's 33 electronic counting machines. The ballots had been "unread" because hundreds of voters had placed their marks outside the rectangular candidate preference boxes printed adjacent to the candidates' names or had used ball point pens whose markings could not be "read" by the machines' electronic scanning devices.

Elections board precinct workers were supposed to equip voting booths with soft-lead pencils or fiber-tip pens recommended by the electronic counting machine manufacturer, Valtec. There were numerous reports, however, of voting booths stocked with blue ballpoint pens. Also, in some instances, voters used their personal pens to mark ballots.

With the 7,000 uncounted ballots discovered Thursday, Barry's slender 1,400-vote lead technically was thrown into doubt, although most election officials said they did not expect the general vote pattern to change.

As it turned out, about 3,835 of the 7,000 ballots were added to the mayoral totals but did not affect the one-two-three positions of Barry, Tucker and Washington.

The remainder of the 7,000 "unread" ballots were a mixture of blank ballots, ballots belonging to Republican and other parties and ballots invalidated for various reasons.

Earlier in the week, ballot counting also was slowed down when it was discovered that election workers had skipped a crucial step designed to detect possible double voting by challenged voters.

The oversight was spotted by Barry campaign observer Philip Ogilvie. At his request the elections board postponed the ballot counting for more than 24 hours while workers went through the 2,000 challenged ballots. It was during that check that the 59 cases of suspected double voting were discovered.

The snag, along with other minor delays, triggererd protests by campaign workers and various demands for reforms and the ouster of elections board head Shari Kharasch.

If the election is certified as scheduled on Wednesday and Tucker and Artisst fail in court, Barry will face Republican mayoral contender Arthur Fletcher in the Nov. 7 general election.