Victoria just became the first Australian state to legalise euthanasia.

Australia’s only assisted-dying scheme will be legal in Victoria from mid-2019 after state parliament passed controversial legislation following more than 100 hours of debate.

The government-led bill passed the Legislative Assembly on Wednesday, after earlier surviving a second scuttling attempt.

The scheme will be accessible only to terminally ill Victorian adults with less than six months to live.

It had gone to the lower house for ratification after the Legislative Council successfully passed the bill, with amendments, 22-18 last week.

But what was forecast as a simple procedure got bogged down in further debate when opponent and Liberal MP Robert Clark proposed a motion to “defer debate indefinitely” late on Tuesday.

Listen: Andrew Denton discusses euthanasia with Mia Freedman. Post continues after audio.

His move was voted down on Wednesday morning and the amendments were agreed to with little fanfare.

The bill requires royal assent and an implementation group will be formed to set up the scheme, including deciding on the lethal medication.

People applying to use the scheme must be determined by multiple doctors to be suffering intolerable pain and be of sound mind.

Except in cases when patients are too incapacitated, the scheme stipulates that the lethal medication be self-administered.