The way has been cleared for the introduction of identity cards after weeks of parliamentary wrangling.
Labour's manifesto promised ID cards would be voluntary
MPs have approved a compromise drawn up by the government, after the Lords repeatedly blocked the scheme.
Anyone who renews a passport will be put on a national ID database - but will not now be forced to have an ID card until 2010, instead of 2008.
The deal delays ID cards until after an election - making it "just acceptable" to the Tories who would scrap them.
Peers had five times rejected the government's original proposals, setting up the prospect of an all-night sitting as the bill "ping-ponged" between the Lords and the Commons.
But In a vote on Wednesday, the House of Lords backed the compromise by 287 votes to 60. MPs later approved it in the Commons by a margin of 301 to 84.
Home Secretary Charles Clarke hailed the deal as a "sensible and acceptable compromise".
He said it introduced "a little bit of uncertainty to the government's plans for implementing the scheme" but added that this was "manageable".
It also "preserved the integrity" of the national ID database, Mr Clarke said, since passport applicants would still have their details entered on it.
The "pricing strategy" for ID cards would be determined after the bill becomes law, he told MPs.
But shadow home secretary David Davis called the deal "a major climb-down by the government".
He said it meant "nobody who does not want an ID card need have one before the next election - and that in itself is worth having" - but he added a Conservative government would still repeal the legislation.
Liberal Democrat constitutional affairs spokesman Simon Hughes called the plans a "ridiculous incursion of the state on the individual".
He said: "If we all renew our passports now we won't be subject to this ridiculous new system for probably at least another 10 years."
But protest group NO2ID said it was not a compromise.
"The problem has always been the database, not the card," said national coordinator Phil Booth.
"Millions are already vehemently opposed, the Home Office will have to round them up and force them to be fingerprinted, which will bring home to the public the true nature of the scheme.
"This is a self-destructive policy to dwarf the Poll Tax."
But Home Office Minister Andy Burnham said he was "delighted" the government had been able to give its backing to the compromise deal which was proposed by cross-bencher Lord Armstrong.
Lord Armstrong said most of the information required for the database would have had to be disclosed as part of the passport application anyway.
"They are not actually seriously increasing the amount of information that is held about them deep inside government," he told BBC News.
There was also "very restricted access" to the database, Lord Armstrong added.
On Tuesday the House of Lords backed another compromise amendment by Lord Armstrong, which would allow people to opt out of the scheme until 2011.
But MPs rejected that compromise plan by a majority of 54 on Wednesday.