New Zealand’s Parliament has unanimously passed a law that will expunge convictions under laws that criminalised gay sex.

Nearly 1,000 men were found guilty of homosexual offences between 1965 and the decriminalisation of homosexuality in 1986.

They will now be able to apply for those convictions to be deleted. There is also the option for a family member or other representative to do this if the person with a conviction has died.

A bill bringing forward the measures passed its third reading in the New Zealand Parliament on Tuesday without a single vote against it.

Unlike similar laws overturning convictions in Canada and Germany, however, specific monetary compensation was not included in the bill – which simply wipes one’s criminal record.

Speaking in Parliament as the bill passed, Minister of Justice Andrew Little said: “As the current Minister of Justice, on behalf of this House and all members who have passed through it since Parliament was established in New Zealand, I would like to say sorry to those men who have carried the stigma and shame of doing nothing other than expressing the love for the person that they did love and for the families who have shared that shame and embarrassment as well, to the many thousands of others who lived in eternal fear of a law that was unjust.

“We have enjoyed the benefit of a better enlightenment, if I can put it that way, a better sense of justice, of respect for the dignity of the person and who they are. This law goes some way to recognising that for the many, many men who were treated in a most unjust way for who they were and doing nothing other than expressing their love. It is the right thing for this House to do.”

“This bill will go some way to putting right a wrong that has been on the records of the thousands of men affected by the unjust law that was finally removed in 1986. It’ll go some way, but it will never replace the years and decades of hurt and harm that have been caused as a result.

“We can be thankful to some small degree that this House and this generation recognises the injustice and has put that right, and it is recognised across this House, from all members, from all parties, who have united together to express this act of justice.”

Grant Robertson, the out Minister of Finance, also gave a moving speech.

He said: “As a man who has been able to live my life relatively freely as a homosexual male, a person who’s able to come to this Parliament and get heckled and abused by the National Party because I’m the finance Minister, not because I’m a gay man.

“That’s a fantastic advance that is built on the shoulders of those men. Not just of those men who were arrested or convicted or who spent time in prison but of those men who just lived their lives as a gay man, who actually just tried to survive through those years.

“So to all of the men who were not arrested and their families we also say sorry. Because this law was and is wrong. The fact that we can expunge the convictions today is a mighty step forward for addressing that.

“But the constant fear and the reminder of the worthlessness and the shame of your mere existence is not something we can put away so easily because it echoes through generations.

“I’ve been deeply moved by the men and their families who have written to me since this legislation came forward and since the first reading, who have expressed the fact that finally there is a time for them to feel some self worth.

“We can’t undo what’s been done to them, but we can now say, ‘It was wrong. We are sorry, and we want to say that out loud.’ To me these men are heroes. They are people that we should look up to. They are people who now need to know that their country actually does value them.”

Louisa Wall, another out MP, reflected on the British colonial history of the archaic law.

She said: “I’m incredibly proud to come from a country and a Parliament that, after 151 years of colonisation—lest we forget; these laws came from our coloniser.

“This is part of our colonial history, and it’s incredibly interesting, when you go to these IPU forums and you have the African countries and you have the Asian countries and they all talk about this being abnormal behaviour, but the reality is the condemnation of this behaviour came from England, and I believe that England, as a colonising power, still has a lot of work to do to help us move from a world that is filled with hate to a world that’s filled with love. ”

She added: “I want to reference that because, in fact, at the moment there are 72 countries in the world where being LGBTIQ means you’re a criminal.

“There are 13 countries in the world currently where, if you are LGBTIQ, the punishment is death, and, unfortunately, of those 72 countries, 36 of those countries are Commonwealth countries. So 50 percent of the countries in the world that criminalise homosexuals are Commonwealth countries.

“So our experience of the criminalisation of homosexuality started 151 years ago with the 1867 Offences Against the Person Act. It was in that year that the punishment ceased to be execution, but it actually was imprisonment for life.

“So 151 years later, I think I stand here proudly as a member of this House, to end what I am going to label a crime against humanity. I label it a crime against humanity by definition, because it’s acts that are deliberately committed as part of a widespread or systemic attack or individual attack directed against any civilian or an identifiable part of a civilian population.”

The move came about because of Wiremu Demchick, a 26-year-old IT developer who petitioned Parliament in 2016 for an apology and expungement after gathering more than 2,100 signatures.

New Zealand leader Jacinda Adern recently became the first NZ Prime Minister to march at an LGBT+ pride parade.

Last year, 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.

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

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