Stanford Parris, a one-term Republican congressman who was outsted in the 1974 "Watergate" sweep, rode Ronald Reagan's coattails to a razor-thin victory over Democratic Rep. Herbert Harris II yesterday in Northern Virginia's 8th Congressional District.

Harris, 54, a three-term incumbent who sought to distance himself from President Carter, was ousted by the mand he defeated six years ago, with the help of a 26-year-old political neophyte, who ran as an independent for the seat on the issue of repealing marijuana laws. Deborah Frantz, the independent, drew more than enough votes to have cost Harris the election.

With vitually all the votes counted, Parris held a 51-to-49 percent margin, a difference of about 2,100 votes. Republicans predicted that Harris probably would demand a recount.

"The good news is we won this damn election," said Parris, 51, in a late-night victory speech. "The bad news is we have to put up with a recount. lBut I'm not worried."

Parris credited his slim victory to voter dissatisfaction with President Carter's economic and defense policies and Harris' support of those policies. c

"People are voting against something -- the incumbent president," said Parris, who blamed his own loss to Harris six years ago on the public's reaction to Watergate.

Harris refused last night to concede defeat. But he did say to supporters, many of whom were crying openly, that the vote count had left him "apprehensive" and "discouraged."

Parris won by more than 4,000 votes in Fairfax County, the district's most populous jurisdiction and an area that has grown more heavily Republican during the last decade. Harris scored a 5,400-vote win in Alexandria, a city that gave him his 4,200-vote margin of victory two years ago. But he failed to carry Prince William County, which has supported him all three of his previous elections. Parris' 3,400-vote margin in Prince William was enough to carry the district.

While Harris officials would not blame Frantz for their apparent loss, officials on both sides speculated that most of the more than 5,500 votes cast for Frantz would have gone to Harris.

"I was never in it to be a spoiler," said Frantz, who spent election night in her Mount Vernon home. "I would rather have seen Herb win . . . [but] I have no second thoughts. I have no regets.

"Herb would have lost anyway, because people this year felt screwed by the Democrats."

Although the opponents avoided the fistfight that Parris' wife, Jane, predicted after their first debate, their race never suffered for a lack of vitriol -- a rare commodity in the usually sedate Virginia elections. Each man bought to the campaign an aversion for his opponent that began almost 20 years ago when they met on opposite sides of Fairfax County issues.

In 16 separate debates Harris and Parris traded a numbing series of accusations. Parris called the incumbent "morally dishonest." Harris, 54, countered that his opponent was guilty of "conflict of interest."

"One of the burdens of running this campaign is being forced to sit here and listen to my opponent bellow like a bull moose," Parris complained at a recent debate in Woodbridge.

"I think it's by far the worst campaign I've been in," agreed Harris, who did nothing to diminish his reputation as a dogged fighter. Harris, in fact, often liked to show vistors to his House office a pair of boxing gloves he was given in 1974 after he knocked Parris out of office.

The campaign in the 8th District, which is one of the largest and most influent in Virginia, attracted national attention and campaign contributions. iRepublicans were hoping that Ronald Reagan's popularity in the Washington suburbs would help the equally conservative Parris defeat the more liberal Harris, whom they accused of masquerading as a moderate.

To get that point across, Parris spent approximately $250,000 on a media campaign that accused Harris of attempint to obscure his voting record, especially on defense issues. Officials in the Harris campaign, which spent less than half that amount on advertising, conceded that Parris' media blitz had an effect on the district. But the Democrats predicted that their own precinct organization in the district would more than compensate for the media exposure.

"He [Parris] put all his emphasis on media and didn't work the grass roots," said Jack Sweeney, a Harris campaign aide.

Parris officials denied that they neglected the neighborhood, door-knocking chores that are considered essential in a district where the margin of victory is generally only a few percentage points. The district includes Alexandria, the southern half of Fairfax County, the northern tip of Stafford County and all of Prince William.

"This is my eighth campaign and this one is as close to textbook as I have seen," said Dick Legett, the press liaison for Parris. "We have just about worked this street as well as we can work it."

Both Harris and Parris directed much of their campigns at federal workers -- both civilian and military -- who reside in an estimated half of all households in the 8th District. While Harris targeted the civilian portion of that group -- "the people who saved the government during Watergate," he called them -- Parris aimed his appeal at military employes.