The decision over whether prisoners should be entitled to vote could be handed to judges after moves to allow some offenders to take part in elections were overwhelmingly rejected by MPs.
The Government had originally suggested allowing inmates serving sentences of up to four years to vote in order to comply with a ruling by the European Court of Human Rights (ECHR) that a total ban was illegal.
But David Cameron had said his own proposal made him feel "physically sick" – and gave his MPs a green light to support a Commons motion calling for defiance of the court ruling.
They duly obliged as MPs voted by 234 to 22 to retain 140-year-old law banning inmates from voting. Ministers as well as Labour frontbenchers abstained in the division.
Although theoretically the result does not tie ministers' hands, the four-year proposal looks certain to be scrapped by the Government. It is now considering a range of proposals to comply with the ECHR while minimising public anger over the suggestion that prisoners should be enfranchised.
One possibility is that judges could be given discretion when jailing less serious offenders over whether to disenfranchise them. Alternatively ministers could propose only giving the vote to those serving short sentences.
They will welcome the scale of last night's Commons vote as it will give them extra ammunition in protracted negotiations with the ECHR over the issue.
After the Strasbourg-based judges ruled the ban to be unlawful, Government lawyers warned ministers that they faced a compensation bill running into millions of pounds if they refused to comply.
The original four-year proposal provoked an immediate wave of cross-party anger, with critics protesting that 28,000 criminals – including people convicted of serious violent and sexual offences – would be enfranchised.
Leading the Commons onslaught yesterday, the senior Tory MP David Davis said: "When you commit a crime which is sufficiently serious to put you in prison, you sacrifice a number of rights. The concept is simple – if you break the law, you cannot make the law."
Jack Straw, the former Justice Secretary, accused the ECHR of going outside its remit by setting itself up "as a supreme court for Europe".
He said: "In 32 years in this House, of the hundreds of complaints from prisoners with which I have dealt, neither I nor my staff can even recall one letter from a real prisoner calling for the right to vote from prison – not one."
Dominic Grieve, the Attorney General, told MPs that the Government would think "laterally if not horizontally" on the resolving the controversy.
He argued that the ECHR had indicated that there could be "substantial flexibility" for countries to lay down detailed rules on prisoner voting.
"It might be desired that a prohibition could be imposed after a particular period," he said.
"The criteria could be different if the judiciary were given complete discretion over whether people should be banned and when such a ban should be applied. So there is a whole range of possible variants available to a legislature... that might well satisfy the Court's concerns."
But Juliet Lyon, Director of the Prison Reform Trust, said: "Just over one third of the total number of MPs voted to retain the ban. The outdated ban... has no place in a modern prison system, which is about rehabilitation and respect for the rule of law."
Bobby Cummines, a former prisoner who is the chief executive of the charity Unlock, said: "If prisoners are excluded from voting, then we don't have a democratic society."