New South Wales has finally decriminalised abortion after an exhaustive, spill-threatening political struggle that seemed to last years.

The bill was brought into state parliament in July by independent MP Alex Greenwich, and has been swarmed with bad opinions, upset Liberals, and eight weeks of debate.

Greenwich said on Thursday that all NSW MPs “can feel proud that our legacy will be decriminalising abortion in NSW,” after the bill was passed on voices with no division.

Liberal MPs Tanya Davies and Kevin Conolly were two of the most vocal detractors of the bill, but even they were brought around on Wednesday evening after final amendments were made to appease conservatives.

Earlier this month the bill had caused a divide between the Liberal NSW party’s left and right factions, as rogue party members threatened to launch a leadership spill against the state’s premier, Gladys Berejiklian.

Passing the final hurdle on Thursday morning, the bill allows abortions on request by a registered doctor for up to 22 weeks gestation. 

New South Wales was the final state to decriminalise abortion, finally bringing it up to speed with the rest of the nation.