Parliament in the southern state of Victoria began discussing the Abortion Law Reform Bill on Tuesday, with the amendment finally passed in the early hours of Friday morning.
It will now go to the upper house for scrutiny.
"A lot of women have been waiting for this for a very long time, I met somebody today who told me she's been waiting for this for 40 years," Women's Affairs Minister Maxine Morand told ABC radio.
"So for a lot of women who remember backyard abortions and abortions being prosecuted, this is a very, very important day for them."
Abortion is available throughout Australia, but the legal grounds for terminating a pregnancy vary from state to state.
In Victoria, where abortion is currently covered under the 1958 Crimes Act, a pregnancy can be terminated if a doctor believes it would protect the health of the woman.
If the new bill becomes law, abortion will be removed from the Crimes Act, giving the woman the sole choice of whether to terminate or proceed with the pregnancy.
After 24 weeks gestation, she would require the support of two doctors for an abortion.
A spokeswoman for the Victorian Law Reform Commission said the state's current law was outdated and the new bill would bring the state more in line with common practice around the country.
Protesters interrupted the debate and parliamentarians of all stripes have been divided over the issue.
But National Party leader Peter Ryan, who opposed the bill, praised the conduct of the debate.
"We have been sitting, I think, something in the order of 50 hours this week," he told parliament after the vote was taken. "It's been a monumental effort on the part of all concerned and I congratulate all that have been involved."
The bill is expected to become law by the end of the year.