ALBANY, N.Y., JULY 1 -- The state legislature today approved a law allowing New Yorkers to appoint friends or relatives to pull the plug on life-support systems if they become terminally ill.

It was the first such legislative action since last week's Supreme Court decision recognizing a constitutional right to refuse medical treatment, Senate Health Committee Chairman Michael Tully said.

First proposed by a committee appointed by Gov. Mario M. Cuomo (D) in 1987, the measure has been the subject of intense debate among the elderly, AIDS patients and religious groups.

"This legislation provides New Yorkers with a vehicle to ensure that treatment is provided according to their own personal, religious and moral convictions, as conveyed by someone they have selected and trust," Cuomo said.

Tully said the Supreme Court decision in the case of Nancy Cruzan gave his bill the final push toward adoption. "It opened the door to the fact that so many people and organizations supported the legislation," he said.

Under the legislation, a person in the presence of two witnesses can designate an adult as a proxy to make health care decisions for him or her. The doctor attending the patient cannot serve as a proxy.

Two attending doctors can determine when a sick person is no longer able to decide on care. A person may state in the proxy agreement whether artificial nutrition or hydration can be cut off.

Private hospitals or clinics could refuse to allow a proxy to order a cutoff of life-support systems for moral or religious reasons. But the hospital would have to inform incoming patients that it did not honor proxy decisions.