The row over prisoners' voting rights has erupted again as human rights judges gave David Cameron six months to change the law in Britain.
The European Court of Human Rights acknowledged that it was up to national authorities to decide exactly who can vote from jail - but 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 only applied to prisoners guilty of certain types of offences and where a sentence of at least three years is imposed. Even 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 scrap the total ban.
A Cabinet Office spokesman said the Government would now consider carefully the ruling on Italy "and its implication on the issue of prisoner voting in the UK".
But Conservative MP David Davis slammed the ultimatum, saying: "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 now complies within six months with the order to grant some prisoners voting rights, the court will "strike out" all similar pending cases from UK prisoners - about 2,500 and counting.
Isabella Sankey, director of policy for Liberty said: "After all the political hot-air and raised tempers over prisoner voting, this judgment shows that while 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."