The Scottish Parliament has voted against plans to introduce ID cards.
MSPs backed a motion which asserted the ID card scheme would not increase security or deter crime, and would have serious implications for civil liberties.
Labour MSPs did not back the motion. They said the Scottish parliament should use its time to debate issues it has power over.
The motion was passed with 68 votes to one, with 38 abstentions.
The motion was put forward by the Community Safety minister Fergus Ewing, SNP member for Iverness.
He said during the debate that ID cards, with or without biometrics, do not deter terrorist activity and that the vast majority of terrorists operate under their true identities.
He added that the £5bn being spent on ID cards should be spent on other things, and he quoted Jerry Fishenden, Microsoft's lead technology adviser for the UK, who said holding huge collections of personal data brings increasing and significant risks.
Bill Aitken, Conservative MSP for Glasgow, said, "An identity card scheme would be acceptable if it worked, but the basic fact is that it simply will not. The ID card scheme is an unnecessary measure, which the Government should scrap."
Robert Brown, Liberal Democrat member for Glasgow, said the UK government has "more information about the individual citizen than any government in the known civilised world". The motion was debated on Wednesday.