Abortion has been decriminalised across Australia after the last remaining state where it was illegal, New South Wales (NSW), voted to reform its laws.
The bill, passed on Thursday, overturns a 119-year-old law which had been criticised by opponents as archaic.
The legislation had generated weeks of heated debate and deeply divided the state's conservative government.
Previously, abortions were possible in NSW only if a doctor deemed there was "serious risk" to a woman's health.
The legislation was passed 26-14 in the state's lower house after discussions about more than 100 possible amendments. It has already been approved by the upper house.
The law makes it legal for terminations to be conducted up to 22 weeks into a woman's pregnancy – or later if two doctors agree.
The reform had been strongly opposed by some activists and MPs who raised objections due to their personal beliefs, as well as concerns about late-term abortions.
But last-minute amendments ultimately persuaded some conservative MPs, and the bill drew support from other parties.
"The current law has meant women and doctors have a threat of 10 years in jail for making this decision and that's not okay," said Labor MP Penny Sharpe, one of the bill's co-sponsors.
"This is a massive step forward for women in this state."