Gay marriage was legalised in all 50 states in the US in June 2015. (PATRICK HAMILTON/AFP/Getty)

Australia’s Northern Territory has formally apologised to gay men for a law which “criminalised love and attraction.”

Those convicted under the legislation banning gay sex, which was struck down in 1983, will now be able to apply for it to be expunged from their criminal records.

With Tasmania having made the same step in April, this means every Australian territory has officially apologised for outlawing gay sex.

Only Western Australia is still to offer to wipe historical homosexual convictions from its records.

In an emotional speech, the Northern Territory’s leader, Chief Minister Michael Gunner, told the state’s 250,000 residents that its government had been guilty of “state-sanctioned discrimination.”

Speaking in Parliament, Gunner said: “Today is about making right.

“It is about making right on hurtful and discriminatory laws tolerated, supported or actively perpetuated by Northern Territory governments.

“Today is about saying to our lesbian, gay, transgender, bisexual, intersex and queer community: We were wrong.

“Laws criminalising homosexuality were wrong.

“Laws criminalising love and attraction were wrong.

“And historical convictions stemming from these laws were — are — wrong.

“Today we pass laws so that these convictions may be struck from personal records,” he added, according to ABC News.

It is believed that around a dozen men were convicted under the historical legislation, though thousands more lived in fear of being arrested.

Related: Same-sex adoption is now legal everywhere in Australia

Gunner recounted the horrific wording of the law, which was in force in his state for 107 years.

“Tucked in between laws about kidnapping and incest is this: ‘Whosoever shall be convicted of the abominable crime of buggery, committed either with mankind or any animal, shall be liable to be imprisoned for life with hard labour,'” he told lawmakers.

“The brutality of that language — ‘the abominable crime of buggery’ — the equating of homosexuality with bestiality.

“This was the law of the land until 1983, within most of our lifetimes. The brutality of that language.

“More so, the brutality of the message: You are not worthy. You are not welcome. You are an abomination.”

Gunner said that he was fully aware of the lives which this law had tainted, opening up about conversations with those affected.

“A Darwin man, who asked to stay anonymous, told us recently: ‘I was 17 and living with an older man. We lived in constant fear of him going to jail. And that was a relationship that lasted 15 years, not some fling,'” Gunner said.

The territory’s leader added that women who were attracted to other women were also abused.

“Sometimes when they were arrested they were they were quite brutally treated by police,” he said. “Physically manhandled. Verbally insulted.

“Told they were dirty lesbians and they should leave town and they were hateful creatures, that no-one wanted them here.”

Tearing up, Gunner spoke about his sister’s upcoming same-sex wedding – which is now legal, after Australia passed equal marriage legislation last year, following a public postal vote.

He said: “Australia has come so far — later this year I will be a proud brother at my sister Lucy’s wedding to her long-time partner Jill.”

Gunner added that he wanted to see the “last vestiges of homophobia and transphobia” eradicated from the territory’s laws.

Opposition leader Gary Higgins supported the apology, saying that he offered his “formal apologies to those who today have criminal records for being in a loving and consensual relationship.”

“It is about time to pass this legislation, and once more, on behalf of the Opposition, to those who today suffered under these past laws and convictions, we say sorry,” added Higgins, who leads the Country Liberal Party.

The Human Rights Law Centre’s director of legal advocacy, Anna Brown, said the government’s apology was a “hugely important step forward.”

She said the ban on gay sex “meant that LGBTI people felt as though they were criminals – well, they were criminals.”

“I guess this meant that socially people felt excluded, they felt isolated, they couldn’t be free to be themselves.

“And what today’s done is sent a clear message that this government values LGBTI people, it values difference, and differences in sexuality and that’s a very welcome step.”

Last month, New Zealand’s Parliament unanimously passed a law to expunge gay sex convictions.

In 2017, the UK government pardoned thousands of men convicted of historic gay sex offences.

Germany also rescinded the convictions of 50,000 men sentenced for homosexuality under a Nazi-era law last year.

The legislation set aside 30 million euros to compensate an estimated 5,000 convicted men who were still alive.

Also last year, the Canadian government allocated $145 million to settle compensation claims from people persecuted for being gay.

Prime Minister Justin Trudeau apologised for the country’s historic approach to the LGBT community, which saw gay people endure purges for decades.

Scotland is also in the process of passing legislation to pardon those convicted of historical gay sex offences.

Watch Gunner’s apology here:

