D.C. Mayor Marion Barry, touting his record for delivering city services and promoting downtown development, won election to a third term yesterday over Carol Schwartz, the Republican challenger who based her longshot candidacy on allegations of government corruption and mismanagement.

Complete but unofficial returns showed that Barry, who was competing in his hardest-fought general election campaign, led Schwartz, an at-large council member, by nearly 2 to 1 in heavy voting. Barry’s margin appeared to be slightly greater than his showing against Democrat Patricia Roberts Harris in the 1982 primary, which previously had been the toughest challenge to his incumbency.

Barry received 61 percent of the vote and Schwartz 33 percent, according to the unofficial returns.

“I may not be perfect, but I am perfect for Washington,” Barry told a huge throng at his victory party at the Omni Shoreham Hotel last night.

In other races, D.C. Del. Walter E. Fauntroy won his ninth term, D.C. Council Chairman David A. Clarke was elected to a second term and four other council incumbents -- Betty Ann Kane (D-At Large), Hilda Mason (Statehood-At Large), Nadine P. Winter (D-Ward 6) and Frank Smith (D-Ward 1) -- easily won reelection.

Ward 3 Democratic nominee Jim Nathanson, a teacher, won election to succeed retiring Democratic council member Polly Shackleton. In Ward 5, Democrat Harry L. Thomas, a retired federal employe who defeated veteran council member William R. Spaulding in the Sept. 9 Democratic primary, also won election.

In a special election in Ward 1 to complete the unexpired term of the late Edna Frazier-Cromwell on the D.C. Board of Education, Wilma R. Harvey defeated four candidates with 60 percent of the vote. Harvey, a former aide to Frazier-Cromwell, had been appointed to the board on an interim basis.

Barry and Schwartz exchanged barbed comments last night after the votes were counted, echoing the increasingly heated crossfire that characterized the campaign.

Schwartz, addressing a cheering crowd at the Washington Plaza Hotel, said the returns demonstrated a high level of discontent with Barry. Schwartz praised “the phenomenal number of people who had the courage to stand up and say that everything in our city is not hunky-dory.”

Barry, speaking with reporters at the hotel, slammed Schwartz’s campaign, saying, “She did a lot of mudslingling . . . . It was a character-assassination campaign. She didn’t run an issue-oriented campaign.”

Barry, who had accurately predicted his margin of victory, strongly disputed Schwartz’s contention that the tally indicated widespread dissatisfaction with him. “She is out of her mind,” he said. “She is crazy. I am mayor and she is not . . . . She’s a sore loser.”

Later, Barry extended the olive branch to voters who rejected him, promising, “We are going to forgive you. We are going to bring you into this fold of our city.”

Ward balloting totals showed that voters in predominantly white Ward 3 backed Schwartz 5 to 1 over Barry, while in predominantly black wards 4, 5, 7 and 8, Barry racked up large victory margins. He also carried three wards where the population is mixed, winning with a 29-vote margin in Ward 2, a center city area that includes Southwest Washington and Georgetown.

“Even though I didn’t do well in Ward 3 we are going to forgive them too,” the mayor said. “ . . . Let us not take the vote in Ward 3 as a vote against anything except progressive government.”

A Barry campaign aide, noting the mayor’s intensive efforts in the last two months to mend fences with Ward 3 voters, who spurned him in the Sept. 9 primary, said Barry intends to “keep trying” to improve his standing in the area. “It is hard to turn around a negative perception in a few weeks,” the aide said.

For Schwartz, who is midway through her first four-year term as an at-large council member, the solid showing in the general election could provide a boost if she runs for reelection in two years. Schwartz won election in 1984 in a tightly contested race.

“This made a lot of political sense for her,” said one council staff member. “She had to build her base to stay” on the council.

The contest for mayor, in which no prominent Democrat challenged the 50-year-old Barry, was marked by the surprise entry of Schwartz, 42, who announced her candidacy in late June and easily won the Republican nomination. In contrast to previous elections in the heavily Democratic District, when the mayoral race was decided in the primary, Barry and Schwartz battled in a sometimes highly personalized campaign that overshadowed the efforts of four other candidates.

Schwartz, a former two-term school board member, declined to discuss her political future last night, but it appeared she would not abandon her criticism of Barry. “He made an awful lot of promises due to this campaign, and let’s keep his feet to the fire,” she said.

Independent Brian Moore, 43, who mounted a scrappy campaign against the principal contenders, tallied only a few percentage points. Statehood candidate Josephine Butler, 66, independent Garry Davis and Socialist Workers candidate Deborah R. Lazar, 29, trailed far behind.

Moore appeared to be surprised by his poor showing, saying, “I really thought I would do better.”

The heavy turnout came despite overcast skies and occasional rain that sent campaign workers scurrying for cover. While the workers seemed to enjoy the final day of a long election season, many of the voters looked dour as they performed their duty at the ballot box.

Schwartz and Barry, the dominant candidates in the race, toured the polling places throughout the day, with Schwartz covering more than 30 precincts in her rented campaign van festooned with Schwartz posters and Barry traveling in his official Lincoln.

Barry began the day at his home precinct, casting a vote for himself at Beers Elementary School. Schwartz voted at Sidwell Friends School. Schwartz, accompanied by several aides and her son Douglas, said she would be “shocked” if Barry received the 60 to 65 percent of the vote he predicted.

The two candidates have wagered a dinner on whether Barry would get 60 percent or more. Barry, who had been criticized by Schwartz for spending city funds on travel and personal expenses, had promised he would use his own money to pay for the dinner if he lost the bet.

Barry, directing a campaign apparatus that included 2,000 volunteers and more than 100 paid employes, harvested important endorsements from prominent business, labor and religious groups. Schwartz won endorsements from the Fraternal Order of Police, an organization of storefront ministers and an interracial coalition of community leaders.

Schwartz was backed by defeated Democratic primary candidate Mattie Taylor, who endorsed Schwartz a week after Barry trounced Taylor. Taylor appeared in a television spot for Schwartz, climaxing a last-minute media blitz by the council member. Barry used radio advertisements but no television ads.

Barry’s poor primary showing in predominantly white Ward 3 underscored a difference of attitudes toward the mayor among whites and blacks, with whites expressing more dissatisfaction. Facing a strong white opponent in the general election, Barry sought to recoup among white voters by mending fences with community leaders in the Northwest Washington ward.

Barry romped to an easy victory in the primary, receiving 71 percent of the vote, compared with leading Democratic challenger Mattie Taylor’s 20 percent.

Barry’s $ 1.3 million campaign war chest this year -- five times what Schwartz raised -- topped his heretofore record-breaking fund-raising effort in 1982, when he banked $ 1.2 million.