The Taoiseach has marked 25 years since Ireland decriminalised homosexuality by hailing the thousands of “unknown heroes” who once lived under fear of prosecution.

Highlighting the transformation in Irish society in recent times, Leo Varadkar, Ireland’s first openly gay premier, said his election would have been “unimaginable” decades previously.

“There are many people who helped change minds and change laws and their contribution should be remembered,” he said.

“People who fought for me before I did so myself.”

He added: “In this country we were too silent on too many issues for far too long. It was the voices of the brave few who gave us all hope and who changed things for everyone.”

Mr Varadkar was speaking in the Dail in Dublin as his administration backed a motion asking for the Irish parliament to apologise to all those convicted of homosexuality before the law changed in 1993.

The Taoiseach referenced historical research that showed that between 1940 and 1978 an average of 13 men a year were jailed for homosexual offences in the state.

Between 1962 and 1972 there were 455 convictions, he said.

“I was born in 1979 and in the three years before that there were 44 prosecutions in this country.  It’s not that long ago,” he said.

“Homosexuality was seen as a perversion, and trials were sometimes a cruel form of entertainment. Others saw it as a mental illness including the medical profession at the time.

“For every one conviction there were a hundred other people who lived under the stigma of prosecution, who feared having their sexuality made public, and their lives destroyed.”

Mr Varadkar said Ireland had a long history of same-sex relations, noting that a number of those who battled for Irish independence were gay.

“It’s no secret that a number of patriots who were involved in the founding of the state – men and women – were homosexual,” he said.

“While the state’s laws affected gay men in a legal sense, they had a chilling effect on lesbians as well.”

Mr Varadkar expressed his admiration for assassinated San Francisco politician Harvey Milk.

“Last summer, I was in San Francisco and I visited the memorial in City Hall in honour of Harvey Milk,” he said.

“Milk was the first openly gay man to be elected to office, and he was assassinated 40 years ago by those who were offended by everything he stood for.

“His picture now hangs in the Taoiseach’s office. Milk believed that hope is never silent.”

Mr Varadkar also recounted the notorious 1982 murder of openly gay man Declan Flynn in a Dublin park, and contrasted it with events 33 years later when Ireland voted to legalise gay marriage.

“I was just a child when Declan Flynn was murdered in Fairview Park, his only crime that he was gay,” he said.

“The 22nd of May 2015 – a date I will never forget – it was the day of the marriage referendum – the bench where Declan Flynn was killed, at Fairview Park, was covered with flowers and notes.

A man walks past pride posters in the window of Panti Bar on Dublin’s Capel street
Between 1940 and 1978 an average of 13 men a year were jailed for homosexual offences in Ireland (Brian Lawless/PA)

“We think of him today on this anniversary, and of the new Ireland that we live in.”

The Fine Gael leader singled out a number of high-profile campaigners and politicians who advocated change in the 1980s and 1990s.

But he added: “Today the people I want to pay a special tribute to are the unknown heroes, the thousands of people whose names we do not know, who were criminalised by our forebears.

“Men and women of all ages who tried to live and love and be themselves in a society where their identity was feared and despised, and who were aliens in their own country for their entire lives.

“We cannot erase the wrong that was done to them.

“What we can say is that we have learned as a society from their suffering.

“Their stories have helped change us for the better; they have made us more tolerant, more understanding and more human.

“This evening we mark the anniversary of the decriminalisation of homosexuality in Ireland and the progress made since.

“We have come a long way, we remember those who suffered and we acknowledge that we still have more to do.

“There is always more to do, whether it’s promoting LGBT equality on other parts of this island and around the world, combating bullying or working to improve sexual health.

“Harvey Milk reminded us of the challenge we face in society to ‘break down myths, and destroy the lies and distortions’.

“He understood why it needed to be done. We do it for ourselves, we do it for others, and, most of all, we do it for the young.”