TRENTON - A slight majority of New Jersey residents support legislation that would allow terminally ill patients to end their lives with lethal medication prescribed by a doctor, a new poll released Monday found.

About the same percentage of people say they would personally want that option, often referred to as physician-assisted suicide.

The bill was scheduled for a vote in June in the Assembly but pulled at the last minute when it became clear it would come up just short of the 41 votes needed to pass.

Under the bill, individuals who receive a diagnosis of a disease that their doctor determines will lead to death within six months would be eligible to obtain lethal doses of medication. Doctors and hospitals would not be required to participate.

Patients would have to be 18 years or older, among other conditions.

Fifty-one percent of Garden State residents support the measure, while 38 percent oppose it, according to Fairleigh Dickinson University's PublicMind Poll.

Fifty-three percent say they want the option to end their lives in this manner and 39 percent do not. The legislation has greater support among Democrats (60 percent) than Republicans (43 percent), the poll found.

New Jersey residents seem to favor "personal autonomy in deciding how and when to end one's life when a terminal illness brings the end sooner rather than later," said Krista Jenkins, the poll's director and a political scientist at Fairleigh Dickinson.

Support for the bill is slightly greater since it was last considered in 2012, when 46 percent of residents approved in another PublicMind poll.

The latest poll of 819 New Jersey adults was conducted from July 14 to 21. It has a margin of error of plus or minus 3.4 percentage points.