The Australian state of Victoria has become the nation's first to legalise assisted dying.
The landmark legislation was approved after more than 100 hours of gruelling debate - including two all-night sittings.
The law means terminally ill patients in Australia's second-most populous state will have the right to request a lethal drug from mid-2019.
They must be aged at least 18 and have less than six months to live.
The law is designed for patients who are in severe pain. It has 68 safeguards, including:
A patient must make three requests to specially trained doctors in order to end their life
A special board must review all cases
Coercion of patients into ending their life will be a crime
Additionally, patients must have lived in Victoria for at least 12 months and be of sound mind.
Patients with some conditions - such as multiple sclerosis and ALS, also known as motor neurone disease (MND) - will become eligible when they have 12 months to live.
The legislative debate included one sitting that lasted for 26 hours, and another that stretched for 28 hours.
The bill was finally ratified with amendments on Wednesday.
It was fiercely opposed by some lawmakers, who had attempted to add hundreds of amendments.