The 25-year-old campaign to restore territory rights has succeeded, clearing the path for the ACT to consider voluntary assisted dying laws next year.
ACT Chief Minister Andrew Barr said he was "delighted" after the Senate decided to restore the territory's right to make laws on voluntary euthanasia.
The bill passed "on the voices", meaning there was no final count of the numbers. It now goes back to the House of Representatives where it is expected to be turned into law.
"Thank you to everyone who has actively campaigned to resolve an injustice that for 25 years has seen ACT and NT citizens denied their democratic rights," Mr Barr said.
Independent senator David Pocock who has instrumental in getting the measure through the Senate said it was a "historic moment".
He paid tribute to "thousands of people in our communities who have refused to let this be pushed off the national agenda".
Senators voted according to their consciences rather than party affiliations, and Senator Pocock said that that "brought out the best in senators".
The federal MP for Canberra Alicia Payne said she was "relieved and thrilled".
"I'm proud that parliament righted this wrong. It's been a long time coming," she said.
Mr Barr said that discussion on a voluntary euthanasia law in the ACT would be "respectful". The territory government would consult the opposition. There would be public consultation. Each MLA would be able to vote according to his or her conscience, and not on party lines.
The ACT Government said it would "use the Christmas and new year period to refine and finalise the public consultation process."
Consultation would last at least eight weeks. It would "include a detailed discussion paper and questions on which all interested stakeholders and the ACT community will be invited to have their say."
Alicia Payne and Luke Gosling's restoring territory rights bill passed following the debate in the Senate.
ACT senators Katy Gallagher and David Pocock both argued hard for the bill. Senator Gallagher paid tribute to her fellow senator. "I do acknowledge David Pocock. He was talking to people, to lobby them," Senator Gallagher said.
The bill repealed the so-called Andrews law, which has prohibited the territories from legislating on assisted dying since it passed in 1997.
"This is a really significant and historic moment and one that a lot of people have fought a long time to witness," ACT senator and Finance Minister Katy Gallagher said.
"I know how much the restoration of territory rights matters to Canberrans."
Ahead of the vote, ACT Chief Minister Andrew Barr revealed that if the ban was overturned then legislation to allow assisted dying in the ACT would be brought forward in the second half of next year.
Mr Barr and ACT Human Rights Minister Tara Cheyne were among the territory politicians, assisted dying advocates and terminally ill Canberrans who were present in the chamber to witness the historic moment.
"This is an amazing result, but it's the product of years and years. It has been decades in the making to right this wrong, to correct the injustice," Ms Cheyne said after the vote.
Leading advocates Andrew Denton and former NT chief minister Marshall Perron declared "it's time" to restore territory rights before the vote.
"Fifty years ago, there was a slogan that lit this country up - 'it's time'," Mr Denton told reporters, referencing Gough Whitlam's famous campaign slogan.
"In 2022, it is way past time for this reform to happen."
Opponents last week conceded the bill would pass and turned their attention to amending the legislation.
NT Country Liberal senator Jacinta Nampijinpa Price's attempt to impose new restrictions on the territories failed, as the amendment was voted down 37 votes to 25.
MORE TERRITORY RIGHTS COVERAGE:
Senator Price had argued that she supported territory rights, but wanted to put safeguards in place to protect vulnerable communities once assisted dying laws were passed.
"All I'm seeking to do is to safeguard the human rights of vulnerable members of the Northern Territory and do it at this stage," she said.
"Nobody is missing out, nobody is losing their rights."
Under her amendment, the territories would be barred from passing legislation that opened up access to assisted dying for under 18s.
The age restriction applies in each of the states' assisted dying regimes.
The amendment would also ensure assisted dying could not be administered solely on the grounds of a person's disability or mental impairments.
Supporters of territory rights argued against the amendment after legal advice prepared for ACT senator David Pocock warned that it could fundamentally undermine the bill.
The advice, from leading barrister Fiona McLeod SC, said the broad definition of disability would mean that a person diagnosed with incurable cancer and just months to live would not be able to access assisted dying.
"These amendments add more restraints and go against the full aim of this bill - to allow the territories the same rights and freedoms," Senator Pocock said.
Labor senator Katy Gallagher also argued against the amendment during Thursday night's debate, insisting it wasn't the federal Parliament's place to determine what safeguards should be put in place in the territories' assisted dying regimes.
The former chief minister said the ACT Legislative Assembly was a "mature" parliament and more than capable of deciding laws from themselves.
Mr Barr earlier on Thursday urged senators to reject the amendment, which he described as a "final rearguard action" from conservatives long opposed to assisted dying.