South Australian lower house MPs have passed legislation to legalise voluntary assisted dying by a clear majority, following a late-night debate.
The House of Assembly met on Wednesday evening to consider a number of amendments to the original bill, which had comfortably passed the upper house last month.
MPs later passed the legislation 33 votes to 11.
Some amendments were agreed, meaning the bill will now return to the Legislative Council for final approval.
When it passes in the upper house, SA will become the fourth state to legalise voluntary assisted dying laws after Victoria, Western Australia and Tasmania.
"We know this will be a bittersweet moment for families who've watched loved ones die in unbearable suffering in the absence of voluntary assisted dying laws," Voluntary Assisted Dying South Australia spokesperson Lainie Anderson said on Thursday.
"We hope they see this is a small victory for those who are gone, but still in our hearts."
The original bill included 68 safeguards and a provision that people wishing to end their lives must be resident in SA for at least 12 months and at least 18 years old.
It requires patients to show they have decision-making capacity and are capable of informed consent and to undergo an assessment by two independent medical practitioners not related to the applicant.
They must have their request verified by two independent witnesses and be experiencing intolerable suffering that cannot be relieved.
A terminal diagnosis and a life expectancy of fewer than six months, or 12 months for a person with a neurodegenerative disease, must also be confirmed.
Most concerns among MPs about the bill have related to coercion and pressure, especially on elderly people.
The legislation had the support of Premier Steven Marshall but all MPs were free to vote according to their conscience.
The bill was co-sponsored by upper house MP Kyam Maher and lower house MP Susan Close and was the 17th piece of legislation to be presented to parliament over 26 years on assisted dying.
"I have imagined this moment so many times over the last few months," Mr Maher tweeted early Thursday morning.
"So bloody pleased & proud and just a little emotional."