An openly gay government minister has mocked the civil liberties campaign of former Shadow Home Secretary David Davis.

Last week Mr Davis announced he is to resign from the Tory frontbench and as an MP to fight a by-election in his constituency on the issue, after the Commons voted to allow terrorist suspects to be detained for up to 42 days without charge.

Ben Bradshaw, Minister of State for Health Services and MP for Exeter, was named the fifth most influential gay person in British politics by PinkNews.co.uk last year.

He said that Mr Davis’ record on gay rights proved he is selective about whose liberties he supports.

Mr Davis formally resigned from the Commons yesterday.

The Labour party has announced it will not fight the by-election.

The Lib Dems and the BNP have also said they will not contest the Haltemprice and Howden seat.

“The notion that David Davis is a libertarian will provoke hollow laughter from gays and lesbians,” said Mr Bradshaw, who became the first MP to have a civil partnership ceremony in 2006.

“Mr Davis has opposed every freedom extended to gay and lesbian people, from the freedom to register one’s partnership to the freedom to serve one’s country.

“He has one of the worst voting records in the Commons on such matters.

“Like most Conservatives, Mr Davis is very selective about whose liberties are worthy of support.

“He supports greater rights for suspected terrorists but not extending basic freedoms to peaceful and law-abiding gay and lesbian people.”

Since Mr Davis’ announcement last week that he was to stand down from Parliament to draw attention to “the slow strangulation of fundamental British freedoms by this government” there has been discussion of his views on homosexuality.

As reported by PinkNews.co.uk last week, since Labour came to power David Davis has voted against the equalisation of consent, the abolition of Section 28 and the rights of gay couples to adopt.

He was absent from votes on civil partnerships.

During his unsuccessful campaign for the Tory party leadership, Mr Davis told journalists that as a teenager he intervened in the intimidation of a gay pupil by a gang of bullies at his inner London school.

Tory blogger Iain Dale has cited this incident as evidence that Mr Davis is not a homophobe.

He said the senior Conservative attended his civil partnership ceremony last Sunday, and was seen to “well up” with emotion.

Mr Dale served as Mr Davis’s chief of staff in the 2005 Conservative leadership campaign.

“David played a part in the proceedings, and I have been told by several people that he was seen to ‘well up’ a bit during the ceremony,” Mr Dale wrote on his blog.

“Having spent the last few days broadcasting to the nation that David “doesn’t do emotion” one can only assume he had a bit of grit in his eye!

“Stonewall reckons he has an anti-gay voting record. They are judging individual votes without looking at the context.

“He and I have had disagreements about some of these votes, but they do not make him anti-gay.

“He hasn’t got an anti-gay bone in his body, and if he had, I wouldn’t have supported him for the leadership.”

In another blog entry Mr Dale wrote:

“I could give you countless examples of proof of David’s support over the years for gay people, starting from when he was at school where he protected a gay pupil from the local bully to helping Michael Brown when he had troubles with the News of the World.”

Cabinet minister Andy Burnham has said that Mr Davis should pay for the cost of the by-election in his constituency.

“Why should the resources at local level and national level be devoted to this? Why?” he said in an interview with Labour magazine Progress.

“The man who was, and still is I believe, an exponent of capital punishment, having late-night, hand-wringing, heart-melting phone calls with (head of human rights group Liberty) Shami Chakrabarti.”

Mr Davis accused the government of personal smears.