Former Shadow Home Secretary David Davis has been re-elected to the House of Commons.

He resigned as an MP last month to fight a by-election in his seat on the issue of detention of terrorist suspects and the erosion of civil liberties.

The government succeeded in getting legislation extending the maximum period of pre-charge detention for terrorist suspects from 28 to 42 days through the Commons on June 11th.

Mr Davis’ majority in the Haltemprice and Howden constituency was tripled, to 15,355, although neither the Labour party nor the Lib Dems contested the by-election.

“We have fired a shot across the bows of Gordon Brown’s arrogant, arbitrary and authoritarian government,” he said in his victory speech.

The turnout was 34%.

A record 25 candidates stood against Mr Davis. The Green Party, with 1,758 votes, came second, closely followed by the English Democrats. All the others lost their deposits.

During the campaign the Greens attacked Mr Davis’ record on gay rights.

“Many voters find his illiberal stance on 28 days detention without charge, support for capital punishment and support for Section 28 just too much to swallow,” said the Green Party’s principal speaker Derek Wall.

“There’s more to civil liberties than one vote in Parliament; it’s not okay for the government to lock you up for four weeks without even telling you what you’re supposed to have done. It’s not okay to deny you a right to criticise the government within a mile of Parliament. If a child is being bullied for being gay, it’s not okay to order his school not to have a policy to protect him.”

Mr Davis shocked political observers and colleagues when he announced he was to stand down as Shadow Home Secretary and as an MP and force a by-election.

He is seen as more right-wing than David Cameron, who defeated him in the contest for the Conservative leadership in 2005.

Mr Davis has said he does not expect to return to the Tory frontbench.

“I took on board that I would lose my Shadow Cabinet post and probably my Shadow Cabinet future,” he said today. The 59-year-old has been an MP since 1987.

Since Labour came to power he 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.

Mr Davis was also absent from a more recent gay rights vote when Tory MPs forced a division in the House of Commons on the Sexual Orientation Regulations.

During his campaign for the 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.

In an interview with The Daily Telegraph last year Mr Davis claimed to be a social liberal.

“People think I’m traditional but I gave away a gay friend at his civil partnership ceremony the other day,” he said.

“In a perfect world everybody would understand absolutely what I stand for.”