The Illegal Migration Bill cleared its final stages in the House of Commons by 289 votes to 230.
Around 20 Tory MPs wanted to require court approval to detain unaccompanied children longer than three days.
But they agreed not to push the issue to a vote, after ministers pledged to work with them on a "new timescale".
Ministers have yet to specify the limits in the bill itself.
The government has made a series of concessions to different sections of the Tory party, in order to head off rebellions during the bill's final stages in the Commons.
However, the bill is expected to run into opposition at its next stage in the House of Lords, where it could be heavily amended.
The bill, unveiled in March, is a key part of Prime Minister Rishi Sunak's plan to "stop" small boats crossing the English Channel.
It will place a legal duty on the home secretary to detain and remove those arriving in the UK illegally, to Rwanda or another "safe" third country, taking legal precedence over someone's right to claim asylum.
This has prompted outrage from opposition parties and charities, which argue the bill is unworkable and could breach international law.
There has also been concern, including among Tory MPs, over new powers in the bill to detain people - including children - on the suspicion that they are liable for removal.
A group of rebel Tory MPs, led by Tim Loughton, tabled an amendment to place new limits on the circumstances in which unaccompanied children could be held.
But as the bill neared its final Commons passage, he agreed to withdraw it "on trust" after Immigration Minister Robert Jenrick pledged he would listen to concerns.
The government introduced amendments of its own, enabling it to set a unspecified limit on child detention in the future, with Mr Jenrick promising to work with MPs on designing a new limit.
However, the commitment was dismissed as vague by the SNP's Alison Thewliss, who added: "We do not trust them to do the right thing here."
Mr Loughton said any changes brought forward by the government in the Lords must include a maximum detention time for children within the bill.
The government faced strong criticism from former Prime Minister Theresa May and former Tory leader Iain Duncan Smith over the potential impact of the bill on victims of modern slavery.
The bill would take away temporary protections against removal from the UK that are currently offered to suspected victims of modern slavery or human trafficking while their case is considered.
The two senior Tories had tabled an amendment, which would have exempted people who have suffered exploitation in the UK from being deported, but they did not force a vote on it.
Speaking in the Commons, Mrs May said the current version of the bill would mean "more people will stay enslaved and in exploitation", by giving traffickers "another weapon" to stop victims going to the police.
To get the bill through, ministers have also promised to consult on new safe and legal routes for migrants, after pressure on the issue from backbenchers.
Under a new amendment, it has committed to publishing a report on new routes within six months of the bill becoming law.
It has also addressed concerns from the Tory right with a separate amendment giving UK minsters more leeway to ignore European court rulings.
However, even with the government's concessions, the bill is still expected to face significant opposition when it proceeds to the Lords in the coming months.
Labour's shadow immigration minister Stephen Kinnock said the bill was an "expensive and unworkable, headline-chasing gimmick".
Liberal Democrat home affairs spokesman Alistair Carmichael said it was "nothing more than half-baked legislation that is immoral, ineffective and incredibly costly for the taxpayer".