Upon receiving an honorary doctorate from the University of Ulster, Ian McKellen praised work done by politicians to protect the rights of LGBT people, but said that the situation was “worse than ever” in some places.

Dr McKellen received the honorary doctorate from, The Hobbit, co-star, Dr James Nesbitt, and then lectured at the first annual Chancellor’s Lecture held at the University of Ulster.

The acclaimed film and theatre actor told the invited audience that more work needed to be done in order to build on advances towards equality for gay people.

The lecture focussed on religious and homophobic prejudice, and discussed the difficulties historically faced by gay people. He said: “Thanks to every gay person in public and non-public life who has come out.

“Thanks to those politicians not in thrall to those constituents who cling to the status quo and who, given referenda, would happily reinstate capital punishment and the beating of children.

“Thanks most perhaps to the cherished national belief that an Englishman – and an Irishman’s – home is his castle and that the state has no business interfering in their bedrooms. Every rotten anti-gay law has been repealed, shaken down from the constitutional tree. So complete is the reversal, that we even have the anomaly of civil partnerships which are not available to heterosexuals and uniquely benefit the gays!”

Speaking ahead of the first vote on the Marriage (Same Sex Couples) Bill, which will take place in the House of Commons on Tuesday, Dr McKellen discussed the advances in rights for gay people.

He said: “The Heavens have not fallen in – though some blame Tsunami and earthquakes, even 9/11, on God’s response to advances in gay freedom.

“The world, at least this part of it, is a better place,” but went on to say: “Beyond these isles things are worse than ever.”

In delivering the Chancellor’s Lecture, Dr McKellen followed in the footsteps of human rights lawyer Baroness Helena Kennedy, journalist and broadcaster Jon Snow, the then Irish President Mary McAleese, the Lord Chief Justice for Northern Ireland Sir Declan Morgan and the Taoiseach Enda Kenny, reports the Derry Journal.

Vice Chancellor Professor Richard Barnett said: “Sir Ian’s performances have guaranteed him a place in the canon of English stage and film actors.

“But Ian Murray McKellen is also a man of deep personal conscience. He is known as a voice of liberty.

“And he is known for his attention to the everyday matters of human courtesy, respect and loyalty – all evident in his acting.”

“We are delighted to be able to honour him today at our Magee campus and to have him deliver the annual Chancellor’s Lecture for the first time in the UK City of Culture.”

Sir Ian McKellen recently said in an interview that he never regretted his decision to come out, and has also never met a gay person who regrets coming out.