Montgomery County Executive Charles W. Gilchrist yesterday led Democrats to a near total sweep of county offices, including all seven council seats, all four courthouse offices, and at least five out of six state senate seats.

Gilchrist won by a 3-to-2 margin, according to final returns, with 107,272 votes to McGrath's 75,189. "The vote margin showed the people of Montgomery felt I've done a good job," Gilchrist told a victory celebration in Bethesda.

In races for the House of Delegates, where the GOP had hoped to make some inroads, the Democrats won 17 out of 18 seats, a gain of two. With all 202 precincts reporting, the lone GOP surviver was incumbent Constance A. Morella, who led the field in the 16th legislative district.

In that same district, Montgomery's only Republican senator, Howard A. Denis, claimed victory with a lead over Democrat Brian Frosh of just over 600 votes. But that contest was likely to be decided by the 1500 absentee ballots, which won't be counted until 4 p.m. today.

Earlier in the evening, Denis, watching the returns at Richard Montgomery High School in Rockville, said he feared becoming the victim of what seemed to be shaping up as a Democratic party landslide in a traditionally liberal-leaning county.

"I'm desperately trying to get on a lifeboat from the sinking of the Titanic," Denis said. Recalling his razor-thin 1978 victory of 211 votes, Denis said, "This is deja vu with a vengeance."

Democrats, who had made strong partisan appeals throughout the campaign, were quick to call the election results a rejection of Reaganomics. "The only surprise in this election is that we have done so well," said Democratic party chairman Jay Bernstein. "It's clearly a repudiation of Reagan policies. There is a message being sent to Washington that you're not a flip-flop if you alter the course."

Bernstein told a cheering crowd of Democrats at the Bethesda Holiday Inn, "Looks like happy days are here again!"

County Republican chairman Paul Clark said, "We're getting blown out of the water in Montgomery County . . . . The people of this county are voting against the national administration. The environment just ripped us apart, and the environment this year is to get rid of Republicans. There's nothing we can do."

In the 15th legislative district, Sen. Laurence Levitan, chairman of the powerful budget and taxation committee, defeated his challenger, state GOP chairman Dr. Allan C. Levey. Three Democratic delegate candidates -- incumbents Judith Toth and Jerry Hyatt, and newcomer Gene Counihan--were elected, while incumbent Republican Del. Robin Ficker ran fifth, trailing another Republican Jean Roesser.

In the 17th district, Sen. S. Frank Shore led a strong Democratic ticket that swept all three delegate seats. Shore easily defeated former Rockville City Council member Phyllis B. Fordham. Del. Jennie Forehand, Del. Mary Boergers and newcomer Michael Gordon also were easy winners.

The GOP lost a seat in the 17th, since Del. Luiz R. Simmons decided to run for county executive and lost in his GOP primary.

Other big Democratic winners were State's Attorney Andrew L. Sonner, Clerk of Court Howard M. Smith, Register of Wills Rosalie A. Reilly and Sheriff James A. Young. Four sitting judges were unopposed. They were Rosalyn B. Bell, James S. McAulliffe, William C. Miller and Irma S. Raker.

Voters also appeared to approve a proposed charter amendment that would force the county to stop doing business with C & P Telephone Co. unless the firm charted local rates to upcounty residents. Gilchrist and county lobbyist Blair Lee IV said the referendum would probably be challenged in court.

A proposed amendment to the state constitution that would give Montgomery residents the option of electing council members by district appeared to be winning approval, according to early statewide returns. The amendment would allow a commission to present to county voters a plan for council districts for the 1986 council elections.

Gilchrist campaigned as a traditional Democrat and fiscal manager who guided the county through federal budget cuts and economic hard times.

The 45-year-old tax lawyer and former state senator from Rockville won his first four-year term in 1978, becoming Montgomery's second county executive, and the first Democrat to hold the office created in 1970.

In his reelection bid, Gilchrist campaigned hard on his record, painting a portrait of the county as economically healthy and fiscally well managed at a time when other jurisdictions were reeling from shrinking resources. In the process, he shed his low-key style and "Good Old Charlie" demeanor to hammer hard against McGrath for being critical without offering specific alternatives.

Gilchrist, who four years ago was such a shy campaigner that he considered it pushy to ask strangers for votes, surprised even his own supporters with his vigorous defense of his record, his command of statistics, and his sharp criticisms of McGrath as an unqualified naysayer with no ideas of his own.

When McGrath accused Gilchrist of incompetent management, the incumbent responded that Montgomery had retained a AAA bond rating because of investors' confidence in the county's fiscal management. When McGrath charged that the county had fumbled economic investment opportunities, Gilchrist replied that Montgomery has the highest capital investment in the state, with 23 new firms relocating in the county and 43 others expanding. And when McGrath criticized Gilchrist's efforts to halt religiously and racially motivated violence, Gilchrist pointed out that his antihate program had been cited as a national model.

McGrath based his campaign largely on the "integrity" question. He repeatedly brought up "Liquorgate," often quoting from the findings of the Merit System Protection Board that Gilchrist abused the merit system when he hired Frank Orifici as deputy director of the department of liquor control. Gilchrist attempted to turn that issue on the challenger, chastizing McGrath for running a negative, low-road campaign.

In the council races, Republicans tried to defy the overwhelming voter registration odds against them by emphasizing the Democrats' primary feud. The current all-Democratic council split into two warring camps during a bloody primary, and the Republicans argued that the council would be so hopelessly fractured as to be paralyzed. But even the Republicans were surprised at how quickly the Democrats appeared to kiss and make up, and present at least the facade of a united front.

Half of the legislative races were decided in the Sept. 14 Democratic primary. Republicans made serious efforts in only three of the county's six districts -- 15, 16, and 17 -- where the GOP fielded full slates.

In the 15th, which stretches from Potomac all the way upcounty to Damascus and Poolesville, Levitan was dogged by Levey's constant charges of conflicts of interest, and by the accusations that, as budget committee chairman, Levitan let state money to the county decline.

Levitan also was bloodied in a hard-fought primary bout with Tony Puca. And after touting his committee chairmanship as the key reason to reelect him, he found himself threatened with losing that position because of an intraparty power shuffle in Annapolis.

Levey, on the other hand, wooed upcounty voters in Germantown, Clarksburg and Damascus by playing on their feelings of isolation in a county whose psychological center lies further south, in the Washington suburbs. Levey also appealed to voters to keep the two-party system alive.