Abortion-rights advocates, frustrated by a filibuster in the Maryland General Assembly early this year, fought back yesterday by handing Democratic primary defeats in Montgomery and Prince George's counties to three longtime abortion opponents and ousting the Baltimore County senator who led the antiabortion fight in Annapolis.

In a tide of apparent anti-incumbent sentiment, unofficial returns around the state late last night showed that as many as seven incumbents could lose their seats in the 47-member Senate. That would be a major turnover in a body that saw no incumbents defeated in 1986.

In Montgomery County, Del. Patricia R. Sher won nearly two-thirds of the primary vote in District 18 and carried a full abortion-rights slate of delegates with her in wresting the Democratic nomination from seven-term Sen. Margaret C. Schweinhaut. There is no Republican opposition in that district. Also, Del. Mary Boergers won by a 2 to 1 ratio over Democratic Sen. S. Frank Shore in the race for a spot in the November general election in District 17.

"The people have spoken," said Schweinhaut, 85, the second-ranking member of the Maryland Senate in seniority and the only woman to take part in the eight-day filibuster. "This is a democratic process, and I sincerely congratulate our new senator."

In Prince George's County, Del. Gloria Lawlah, an abortion-rights advocate, narrowly defeated Sen. Frank J. Komenda in District 26 in the Democratic primary. Komenda, a 16-year legislator, was an opponent of abortion during the 1990 session.

Abortion-rights groups had made Sher, Boergers and Lawlah top priority candidates, hoping that a shift in the primary could lead to a filibuster-proof Senate in 1991.

In Baltimore County, Sen. Francis X. Kelly, a leader of the antiabortion filibuster, lost to Janice Piccinini, a former head of the state teachers union who made her support for abortion rights the prime issue of her Democratic primary campaign.

"We destroyed the floor leader of Right to Life, and we will pass, unquestionably, pro-choice legislation in 1991 to keep abortion safe and legal," said Steven Rivelis, leader of a political action committee that contributed about $40,000 to abortion-rights candidates.

"Nobody expects to sweep everything," Rivelis said. "To be able to beat Frank Kelly and to have Patty Sher in is as much as one could ask."

Michael Burns, head of the Maryland Right to Life PAC, said he was "ambivalent" about the outcome. "As a partisan politician, I'm not surprised," Burns said. "It's hard to be a Democrat and be conservative. Frank Kelly knows that now."

Although abortion was a cutting issue, some general anti-incumbent sentiment was at work in yesterday's primaries. A handful of Democratic incumbents for whom Gov. William Donald Schaefer campaigned vigorously, including Sen. John A. Pica in Baltimore, faced serious struggles in their races.

In Prince George's, former state senator Tommie Broadwater Jr., a Democrat trying for a comeback after his imprisonment on fraud charges in the 1980s, fell short in his challenge to Sen. Decatur W. Trotter in the 24th District.

Republican Sharon W. Horneberger in Carroll County and Democrat Troy F. Brailey in Baltimore also were trailing challengers. Horneberger, an abortion-rights supporter, was falling behind Larry Haines, who is described as being opposed to abortion.

Jim Smith, Schaefer's campaign manager, said he saw no distinct pattern in the apparent defeat of incumbents. In some cases, he said, abortion was a decisive issue, but local issues and general anti-government sentiment were more important elsewhere.

In Montgomery, Boergers said after returns began rolling in that voters agreed with her that Shore had lost touch with voters. "Equally obviously, the abortion issue played a key role," Boergers said. "He was down to his Right to Life base."

But Boergers also said she felt it was significant that Sher carried a slate of abortion-rights candidates with her. Among the delegates defeated in District 18 was C. Lawrence Wiser, who ran on a slate with Schweinhaut. Wiser, coincidentally, was the last senator from Montgomery to be defeated in a bid for reelection, when he lost in 1978.

Since March, when a determined minority of senators staged a filibuster and blocked an abortion-rights bill, advocates have been pointing toward the elections. Political action committees on both sides of the issue poured more than $115,000 into General Assembly campaigns.

In Prince George's County, Democratic Sen. Leo E. Green had been put on the defensive by civic activist Terezie S. Bohrer, but won last night.