"But yesterday this house allowed the state to lock up potentially innocent citizens for up to six weeks without charge."
David Cameron, the Conservative party leader, said he wished Davis well.
"It's a personal decision, a decision he has made. I wish him well," he said.
Nick Clegg, leader of the opposition Liberal Democrats, said that his party would not stand against David in the by-election in the north of England constituency.
Davis will be replaced in his home affairs role by Dominic Grieve, the party's spokesman on legal affairs.