The Government made a “compelling and forceful” argument against giving prisoners the vote, David Cameron said after two convicted murderers had their appeals thrown out.
The Prime Minister insisted the decision by the Supreme Court was a “victory for common sense” and added it had “stood up for democracy”.
Seven Supreme Court justices in London dismissed challenges brought by Peter Chester and George McGeoch, who have been fighting for the right to vote while behind bars.
Chester, who is in his 50s, is serving life for raping and strangling his seven-year-old niece, Donna Marie Gillbanks, in Blackpool in 1977.
McGeoch, from Glasgow, is serving his life sentence at Dumfries prison for the 1998 murder of Eric Innes in Inverness.
During Prime Minister’s Questions, Mr Cameron said: “Can I congratulate the attorney-general on this excellent result?
“The attorney-general fought this case himself in front of the Supreme Court. He made a compelling and forceful argument and it is a victory for common sense.”
The European Court of Human Rights ruled in 2005 that a blanket ban on serving prisoners going to the polls was incompatible with the European Convention on Human Right, relating to the right to free and fair elections.
The European court said it was up to individual countries to decide which inmates should be denied the right to vote from jail, but that a total ban was illegal.
Last November, the Government published the Voting Eligibility (Prisoners) Draft Bill.
It has put forward three options a ban for prisoners sentenced to four years or more, a ban for prisoners sentenced to more than six months and a restatement of the existing ban.
Lady Hale, deputy president of the Supreme Court, said: “Prisoners’ voting is an emotive subject.
“Some people feel very strongly that prisoners should not be allowed to vote, and public opinion polls indicate that most people share that view.”
There is still a “substantial majority against it”, she said, adding: “It is not surprising therefore that in February 2011, elected parliamentarians also voted overwhelmingly against any relaxation of the present law.”
Lady Hale said: “In such circumstances, it is incumbent upon the courts to tread delicately.”
Lord Sumption said: “In any democracy, the franchise will be determined by domestic laws, which will define those entitled to vote in more or less inclusive terms.”
He pointed out: “The exclusion of convicted prisoners from the franchise is not a universal principle among mature democracies, but neither is it uncommon.”
“From a prisoner’s point of view, the loss of the right to vote is likely to be a very minor deprivation by comparison with the loss of liberty.”
Sean Humber, head of human rights at law firm Leigh Day, which currently represents more than 500 prisoners taking legal action through the European Court of Human Rights, said: “This Supreme Court judgment simply confirms the current position under UK and European Union law that prisoners in the UK do not have the right to vote.
“However, as the Supreme Court itself recognised, as a signatory to the European Convention on Human Rights, the UK also has obligations under international human rights law.”