The NSW lower house has voted to decriminalise abortion following almost three days of heated debate in parliament.

The historic bill passed 59 to 31 in a conscience vote, which will remove abortion from the state's criminal code.

Premier Gladys Berejiklian voted in favour of decriminalising abortion, along with her colleague Health Minister Brad Hazzard. Many of the Liberal Party's 35 MPs voted against the bill.

Thank you to the MPs of the NSW Parliament Legislative Assembly who voted to support the history making transfer of the abortion laws to a health framework. Out of the Crimes Act, out of the darkness. The best 11.5 hours debating I’ve had in 28 yrs in parliament. @NSWHealth — Brad Hazzard (@BradHazzard) August 8, 2019

A majority of Labor MPs voted in favour of the bill, along with the Greens and Shooters, Fishers and Farmers Party MPs.

The successful vote came after almost 12 hours of debate on Thursday and just hours after Attorney-General Mark Speakman and Planning Minister Rob Stokes dropped an amendment, which would have required later-term abortions to be approved by a hospital advisory committee.

Former Minister for Women Tanya Davies voted against the bill after unsuccessfully introducing an amendment to lower the threshold of late term abortions from 22 weeks to 20 weeks.

NSW Parliament's Lower House has voted to decriminalise abortion 59-31! Congratulations to activists who have been campaigning for decades to make this happen. pic.twitter.com/fqtUjGQVwp — Mehreen Faruqi (@MehreenFaruqi) August 8, 2019

The NSW Legislative Assembly has made history: we have just voted to decriminalise abortion. — Alex Greenwich MP (@AlexGreenwich) August 8, 2019

The Reproductive Health Care Reform Bill 2019 will allow terminations up to 22 weeks, as well as later abortions if two doctors, considering all the circumstances, agree the termination should take place.

The proposed legislation was introduced by Independent MP Alex Greenwich with 15 co-sponsors, including Health Minister Brad Hazzard and Greens MP Jenny Leong.

The bill will be analysed by a Parliamentary social issues committee next week, and is expected to be voted on in the Upper House the following week.