Labour leader Ed Miliband has pledged support for a campaign to pardon men convicted of historic gay sex offences.

Relatives of gay codebreaker Alan Turing delivered a petition to Downing Street last week calling for the 49,000 men convicted under anti-gay laws to be pardoned.

Miliband told GT (Gay Times) that, if elected Prime Minister, he would make the matter a priority.

He said: “I think it’s worth saying that we DO want to extend the principles being applied to Alan Turing and his family, to be able to say to others who were convicted of a criminal offence simply because of the person that they loved – whether they are alive or no longer alive – that we can get a pardon for them.

“I think it’s a stain on our society, frankly. I think it’s right what’s been done in relation to Alan Turing and his family, but there are also other families that will have had relatives who were convicted, as I say, simply because of the person they love. And I think it’s time we acted for them, too.

“I think we owe it to the LGBT community to make this move.”

Proponents of a pardon want the measure applied on a case-by-case basis, using modern consent laws to evaluate whether people should be pardoned.

People with historic gay sex convictions who are still alive can already have them expunged under 2012’s Protection of Freedoms Act – but records cannot be expunged posthumously.

The Queen granted a rare posthumous pardon in 2013 to Alan Turing, under the Royal Prerogative of Mercy.

The Liberal Democrats last week pledged support for the campaign.