David Cameron put the UK on collision course with Europe today as he signalled he will fight plans forcing the UK to give prisoners voting rights.
The Prime Minister insisted the decision was one for MPs, not a "foreign court", after human rights judges issued an ultimatum giving Britain six months to change the law.
He told MPs he backed their overwhelming vote last year that effectively opposed the European Court of Human Rights (ECHR) ruling.
At Prime Minister's Questions, he said: "I have always believed when you are sent to prison you lose certain rights and one of those rights is the right to vote.
"Crucially, I believe this should be a matter for Parliament to decide, not a foreign court.
"Parliament has made its decision and I completely agree with it."
It comes after Labour said it would back Mr Cameron if he chose to oppose the ruling.
Shadow chancellor Ed Balls said there was cross-party agreement about not giving the vote to prisoners and the ECHR ruling was the "wrong thing".
"This is one of those times in politics where there is cross-party consensus," he told ITV's Daybreak.
"The court first said this in 2004, that prisoners should be able to vote, and Labour then said we disagree and we did not implement it.
"I am all in favour of prisoners having the right kind of support and being rehabilitated but voting is one of the things I think you give up if you go to prison.
"So we all agree that this is the wrong thing."
He added: "If David Cameron is going to go out there and fight this one, we will be supporting him on that."
The ECHR acknowledged that it was up to national authorities to decide exactly who can vote from jail - but said denying the right to all inmates indiscriminately is illegal.
The ultimatum was issued as the Strasbourg court ruled in a separate case that depriving an Italian convicted murderer of voting rights did not breach his human rights.
But the judges emphasised that this was because in Italy, unlike the UK, there is no "general, automatic, indiscriminate" ban in place.
The ruling pointed out that in Italy the loss of voting rights applied only to prisoners guilty of certain types of offences and where a sentence of at least three years is imposed. For those affected, the right to vote can be restored three years after the sentence has been completed.
The judges effectively challenged the UK Government to agree within six months on what parameters to set for British prisoners, and to scrap the total ban.
Last year MPs voted by 234 to 22 in support of a non-binding motion tabled by senior Tory David Davis and Labour former justice secretary Jack Straw opposing plans to give inmates the vote.
Mr Davis criticised the ultimatum, saying: "This regrettable decision is an infringement of the UK Parliament's right to decide on matters which are fundamental to the British way of life, and which are not appropriate to judicial intervention.
"This will inevitably lead to a clash between the express wishes of the UK Parliament and the assertions of the European Court and will not help the court achieve its important functions in stopping breaches of fundamental rights throughout Europe."
The judges said that if the UK complies with the order to grant some prisoners voting rights within six months, the court will strike out all similar pending cases from UK prisoners - about 2,500.
That would remove the threat of massive potential Government damages payments to prison inmates if all complaints went through the Strasbourg court and were upheld.
The ruling declared: "It is up to (Council of Europe) member states to decide how to regulate the ban on prisoners' voting."
The judges said they now accept the UK Government argument that "each state has a wide discretion as to how it regulates the ban, both as regards the types of offence that should result in the loss of the vote and as to whether disenfranchisement should be ordered by a judge in an individual case or should result from general application of a law".
The wrangle with Strasbourg began when UK inmates complained that the loss of voting rights violated a Human Rights Convention Article guaranteeing the "right to free elections".
The ECHR has twice ruled the UK's total ban illegal.
Isabella Sankey, director of policy for human rights campaign group Liberty, said: "After all the political hot air and raised tempers over prisoner voting, today's judgment shows that whilst the Court of Human Rights must uphold core values against blanket and irrational Victorian laws, it will allow individual countries a great deal of discretion about how best to apply human rights at home.
"The Commons huffed and puffed but the court had no intention of blowing its house down. Perhaps we can now have a more rational domestic debate about what prisoner voting bans really achieve and if and when they might be appropriate?"
A London law firm acting for more than 550 prisoners challenging UK voting rights laws warned that further delays in changing domestic rules could leave the Government facing damages payouts.
Leigh Day & Co is handling applications relating to inmates' inability to vote in the May 2010 general election.
Partner Sean Humber said: "In its latest judgment, the European Court of Human Rights has confirmed again that the UK's continuing blanket ban on prisoner voting is unlawful.
"The UK Government must now come forward with the necessary legislative proposals to rectify the continuing breach.
"Continuing inaction is likely to leave the UK further exposed to claims for compensation by serving prisoners."