After 12 weary days and several angry outburst from candidates most concerned with the outcome, the D.C. Board of Elections and Ethics early yesterday completed counting the ballots in the city primary election. The results showed that Councilman Marion Barry, maintaining the lead he took on election day, has won the Democratic mayoral nomination.

An unofficial final computer printout of the results, released by the board, showed Barry the victor over his nearest challenger, City Council Chairman Sterling Tucker, with incumbent Mayor Walter E. Washington third.

Completed tabulations showed these results:(TABLE) Barry(COLUMN)32,746 Tucker(COLUMN)31,232 Washington(COLUMN)29,837(END TABLE)

Barry's vote total represented about 34.6 percent of all the ballots cast in the Democratic mayoral primary compared to about 33 per cent for Tucker and 31.5 percent for Washington.

The final vote totals also left unchanged the results in two close races for City Council seats in Wards 5 and 6. Incumbent Ward 5 Councilman William Spaulding defeated Robert Artisst, 4,339 votes to 4,010. In Ward 6, incumbent Nadine Winter received 5,029 votes, retaining her Council seat by a slim 100-vote margin over Patricia Press.

Results of the Sept. 12 primary were released by the board pending official certification on Wednesday, according to board chairwoman Shari Kharasch, who said yesterday that the elections staff and an auditor will check the tabulations again and "go over everything" before certification.

Assuming that he is certified the winner in the Democratic mayoral race , Barry will face Republican Arthur Fletcher in the Nov. 7 general election.

Neither Barry nor Mayor Washington could be reached for comment on the board's final tabulations.

Tucker, however, said yesterday he intends to carry out his previously announced intention to seek a court injunction to set aside the election and order a new one.

"If Mr. Barry wins, I congratulate him," said Tucker, "but I am less concerned now about the outcome than I am about the process and the serious question about whether voters can have confidence in the results."

Tucker said his campaign advisers will file a court challenge to the election either today or tomorrow in order to halt the proceedings before certification.

"Our assumption is that things are wrong with the election that prevent certification," said Tucker. "The board assumes everyting is all right and wants to certify the results."

Artisst already has gone to court to challenge the results in Ward 5.

Winfred Mundle, the board's general counsel, has said that District law requires that any attempts to set aside elections be made only after the election has been certified by the board. But Tucker argued yesterday that there is "a legal difference of opinion" in that area of election law.

"The board seems to have no desire to pursue this, but we will file affidavits to indicate there are problems in the election which warrant holding a new one . . . particularly with the election so close and with each mayoral candidate getting a third of the vote each."

In calling for a new election on Friday, Tucker enumerated 16 evident or alleged problems that have beset the vote tabulation. These ranged from the disclosure of "unread" ballots to the inability of some voters to vote in one precinct because of a temporary shortage of ballots. He rejected the idea of asking for a recount, saying the board's initial counting procedures left the elections process "in utter turmoil."

The board's final tabulations showed incumbent D.C. Del. Walter Fauntroy, who is unopposed in his reelection bid, receiving 73,231 votes in the Democratic primary. Republican Fletcher beat out his mayoral primary challenger, Jackson Champion, 3,258 votes to 546.

In the race for City Council chairman, Councilman Arrington Dixon received 48,382 votes in the Democratic primary compared to 35,059 for Councilman Douglas Moore and 4,595 for the Rev. John Martin.

School board member Betty Ann Kane defested her closest competitor, former housing official H. R. Craqford, 28,907 votes to 24,912, in a race for an at-large City Council seat.

In Ward 1, incumbent David Clarke received 7,359 votes, easily defeating three challengers. In Ward 3, incumbent Polly Shackleton won re-election handily in the primary with 9,450 votes to 2,662 for her challenger, Joel Joseph.