Virginia Democratic Lt. Gov. L. Douglas Wilder, a grandson of slaves, won a razor-thin victory over Republican J. Marshall Coleman yesterday to become the first elected black governor in U.S. history. "I am here to claim to be the next governor of Virginia," an exultant Wilder told supporters at a Richmond hotel last night. "The people of Virginia have spoken." However, 15 minutes later, Coleman told his supporters at a nearby hotel that "this race is not yet over." He said the outcome "won't be known tonight -- it may not be known for some time." With all of the state's 1,967 precincts counted, Wilder defeated Coleman by 7,732 votes out of a record 1.77 million cast, or 50.2 percent to 49.8 percent, according to an unofficial count by the Associated Press. The United Press International count, also unofficial, showed Wilder with a 13,000-vote lead with 99 percent of the precincts reporting. Coleman, while not conceding defeat, said, "If my opponent is the winner, I congratulate him and I support him." But he added, "We don't yet know what the outcome is." Wilder, however, said he was "confident the outcome will prevail." "If it takes place in Virginia, it can take place anywhere," Wilder said on the ABC-TV program "Nightline." Wilder ran far behind his victorious Democratic ticketmates, Donald S. eyer and Mary Sue Terry, though exit polls and pre-election forecasts showed him with a big lead. Nonetheless, the victories by Wilder, Beyer and Terry gave the Democrats their third consecutive sweep of the top three jobs in state government. The closeness of the gubernatorial race caused confusion and tension at both Wilder and Coleman headquarters, where the mood of the crowds fluctuated from euphoria to concern, depending on the hour and the vote tally. Because the outcome remained in doubt late into the night, what might have been a wildly jubilant celebration at Wilder's headquarters was instead somewhat muted. In his address to supporters, Wilder referred to the historic nature of the election, saying at one point, "America sees Virginia." Calling his campaign and electoral victory a "spiritual thing," Wilder invoked the memory of Abraham Lincoln, saying that as a boy he had read the president's writings about freedom and equality. "I knew they meant me," Wilder said. The campaign, he added, fulfilled "all of the dreams that could be dreamed by any person." "No one can blame it on the weather," Wilder said of last night's result. "No one can say that a single certain issue dominated my campaign." Despite that assertion, Wilder did appear to benefit from his highly publicized stance in favor of abortion rights. One exit polling sample indicated that single-issue voters concerned about abortion were breaking 62 percent to 38 percent for him, but he said on "Nightline" that there is "no single-shot litmus test" that Democrats around the country can look to as a formula for success. He said Democrats must be able to run "and not be accused of tax-and-spend . . . of being weak on crime" and must have "a very good record of cutting taxes." The 58-year-old Wilder said the significance of his election may "hit me later on . . . . Perhaps the next several days, or even maybe later tonight or in the morning, I'll have a moment of quiet reflection and be able to say, what does all of this mean? "Personally," he added, "it means a great deal to me that Virginians cast ballots based on merit and qualifications alone." For the moment, however, Wilder said he was savoring the fact that he had led his party to its third straight sweep of statewide offices, using a theme of "continuing Virginia's prosperity." Asked what his grandfather, who was born into slavery, might think of his election, Wilder said: "He would be saying that he thought that someday something like this should happen, and that it could happen, but it was something that he might not think he would see his grandson do." Under Virginia's election laws, absentee ballots were supposed to have been included in last night's tabulations, but Coleman indicated that some precincts might not have rounded up all of them, and if that were so, he could pick up some votes later. But Wilder said that "all of them are supposed to be in." Joe Elton, executive director of the state Republican Party, said he believed that most of the absentee ballots had been counted. However, he said, "Errors are made routinely, and finding 5,000 or 6,000 votes isn't outside the realm of possibility." The losing candidate can petition for a recount if the difference between the candidates' vote totals is 1 percentage point or less, according to Audrey Piatt, director of operations for the state Board of Elections, which is to certify the election results Nov. 27. Coleman stopped short of calling for a recount, but said he has an "obligation to the people of Virginia to make sure the sanctity of the process is upheld . . . and this really reflects the will of the people." Voters in Northern Virginia provided Wilder more than enough of a plurality for his victory, with Fairfax County alone giving him a margin of 28,000 votes. Beyer and Terry handily won their races for lieutenant governor and attorney general, respectively, leaving Wilder trailing the ticket, as he did in 1985, when he became the first black person elected to statewide office in Virginia. Voting was so heavy in Portsmouth that the polls stayed open until 8:45 p.m. to accommodate long lines of voters who were in place at the 7 p.m. deadline. Wilder fared poorly in rural Virginia, particularly in politically conservative communities with small black populations. Coleman did best in the Republican's native Shenandoah Valley, in Southside, and in the central core of the state. Somewhat surprisingly, Wilder also trailed in Southwest Virginia, a Democratic bastion that has been torn by a bitter coal strike for most of the year. Wilder also failed to carry more than 20 cities and counties that he won in 1985, nearly every one them a rural jurisdiction in central and Southwest Virginia. He was able to reverse his 1985 fortunes in only two jurisdictions, Fairfax City and Greensville County. Democrats also easily retained control of the 100-member Virginia House of Delegates, though the legislature's second-ranking member, House Roads Committee Chairman Donald A. McGlothlin Sr., was beaten by nearly 2 to 1 by a write-in opponent, United Mine Workers leader Jackie Stump. McGlothlin's defeat could be attributed to the seven-month-old coal strike in Southwest Virginia, where his son, a Circuit Court judge, has imposed more than $30 million in fines on striking miners. None of the 40 state Senate seats was up for election. Wilder, who moderated his views to win election four years ago as lieutenant governor, becoming the first black Virginian to hold statewide office, benefited this year from an unexpected issue: abortion. Coleman steadfastly opposes abortion in nearly all cases, a position at odds with Wilder's abortion-rights stance and that of a significant part of the electorate. "I don't think there is any question Virginia provided a laboratory for the abortion issue," said Thomas R. Morris, a University of Richmond political science professor. Abortion was widely perceived to be a pivotal issue in both gubernatorial elections. Jesse L. Jackson called yesterday "a great day" and said he saw the outcome as evidence of "the maturing of white America." "There's less insecurity and less color shock, less racist and less sexist behavior," Jackson said. "There are a lot of battles to be fought, but today was a real blow against racism and sexism." The race for the governorship was far and away the most expensive in Virginia history, largely because of the $12 million Republican primary in June and the massive contributions that were made in the fall election to sustain the two candidates' extensive television advertising. Coleman and Wilder together raised another $12 million for the general election. The TV commercials financed by the contributions reflected the differing styles and strategies of the two camps. Coleman started early by assailing Wilder's record and character, a tactic that initial polls suggested heightened the Republican's own negative image among voters. For a brief interval several weeks ago, Coleman went positive. That strategy was soon abandoned. Wilder started with positive themes that stressed his life story and his ability to form coalitions. The underlying message was clear: He wanted to reassure independent and Republican-leaning whites that he was an approachable politician. After the Supreme Court's ruling in the Webster abortion case in July, Wilder's media campaign seized on that volatile issue, casting it in terms of government intervention and personal privacy, and invoking such symbols as the American flag and Thomas Jefferson's Monticello to support Wilder's abortion-rights stance. Morris of the University of Richmond said he regarded that commercial as a turning point in the campaign because it paralyzed Coleman by casting the debate about abortion in conservative terms that favored Wilder. "That ad gets the Oscar," Morris said. Abortion was easily the overriding issue of the campaign. Coleman's central staff included activists from the state's antiabortion organizations, and Wilder's media consultant previously worked for a national abortion-rights group. Polls indicated that Wilder benefited more from the issue than Coleman did because most Virginians favor at least some degree of abortion rights. Coleman opposes abortion in nearly all cases. If abortion was the campaign's most visible issue, race was widely perceived to be the most significant force underlying the election. Although Wilder made relatively few overt appeals to the black community, support for him there was virtually monolithic. The Richmond Crusade for Voters, a predominantly black organization, passed out a handbill at polling places yesterday that read in part: "You will not see another election like this one in your lifetime. You can help make history that will be known WORLDWIDE on Nov. 7, 1989." Staff writers Stephen C. Fehr, John F. Harris and Megan Rosenfeld contributed to this report.