A so-called "natural death" bill that gives terminally ill people the right to order that their lives not be prolonged by artificial means squeaked through the Virginia Senate today by a vote of 21 to 18.

Opponents of the bill, sponsored by Del. Bernard S. Cohen (D-Alexandria) argued that it was unnecessary and could encourage abuses by doctors, who are granted legal immunity under the measure.

Fourteen other states have adopted similar bills.

Sen. Ray L. Garland (R-Roanoke), urged his colleagues to reject the bill, which he said would create "an elaborate legal rigamarole" by attempting to legislate matters of life and death "best left uncodified."

As antiabortion activists who lobbied against the bill watched from the packed gallery, Sen. Joseph V. Gartlan Jr. (D-Fairfax) argued that the immunity provision was "simply too high a price to pay." Another opponent, Sen. John Buchanan (D-Wise), a physician, recounted several of his cases including that of an 80-year-old minister who suffered a heart attack and subsequently "cheated death" after being revived on a respirator.

Senate Majority Leader Hunter B. Andrews (D-Hampton) defended the measure, citing its "broad-based support" by the Virginia Medical Society and the Richmond Catholic Diocese, which lobbied unsuccessfully to bar pregnant women from the act. "Let's not kill this bill," he said. "Let's give this right to all those who want this right."

The serious, hour-long debate was lightened by an announcement from Sen. Onico Barker (R-Danville), who said he would abstain from voting under the Senate's conflict of interest rules. Barker is an undertaker.

The Northern Virginia delegation split evenly on the measure, which now goes back to the House for agreement on minor amendments. Democratic Sens. Edward M. Holland of Arlington and Richard L. Saslaw, Adelard L. Brault and Clive DuVal II, all of Fairfax, voted for the bill. Sens. Gartlan, Charles L. Waddell (D-Loudoun), Charles J. Colgan (D-Prince William), and Wiley F. Mitchell (R-Alexandria) voted against it.