Ministers will talk to councils before deciding how many can be resettled.
The UK currently takes children from refugee camps in Syria and its neighbours but there has been pressure to take some who are already in the EU.
Labour said the announcement, made at Prime Minister's Questions, did not go far enough and more action was needed.
The government agreed in January to take some lone child refugees directly from North Africa and Middle East - but rejected calls to accept 3,000 children who had made it to Europe because it did not want to encourage others to make the "lethal" journey.
Now, in a change of heart, children registered in Greece, Italy or France before 20 March - when the EU struck its refugee deal with Turkey - will be eligible for resettlement in the UK.
The government said the retrospective nature of the scheme would avoid creating a "perverse incentive" for families to entrust their children to people traffickers.
It would mean the UK can focus on the "most vulnerable children already in Europe without encouraging more to make the journey", Downing Street said.
Mr Cameron, who has been facing the threat of a Conservative backbench rebellion in a vote next week over the issue, said he had accepted a revised amendment to the Immigration Bill put forward by Labour peer Lord Dubs.
He told MPs: "I am also talking to Save the Children to see what we can do more, particularly about children who came here before the EU-Turkey deal was signed.
"What I don't want us to do is to take steps that will encourage people to make this dangerous journey because otherwise our actions, however well-meaning they will be, could result in more people dying than more people getting a good life."
Ministers get irritated when critics suggest the government's not done enough to help Syrian refugees.
They point to the thousands already promised help through resettlement programmes and billions of pounds of aid from the UK. But a majority of MPs demanded more action to help unaccompanied children.
David Cameron has always insisted that nothing must be done to encourage refugees to make the dangerous journey to Europe so now ministers have found a compromise.
It's a political solution to avoid a defeat in the Commons but Tory MPs and several charities have called it "tremendous".
The implementation of the programme now depends on local authorities who have to make sure they have the funding, school places and social service support that many of these traumatised children will require.
Downing Street hasn't put a figure on how many might be helped, but the expectation is that it will be thousands and Conservative MPs have promised to keep up the campaigning.
There does remain some concern though, that what's been announced won't help the most vulnerable, who might not have registered and who've disappeared from the system altogether.
The SNP's leader at Westminster, Angus Robertson, who pressed Mr Cameron on the issue, said he welcomed what he said appeared to be the "beginning of a U-turn".
Mr Cameron has been under pressure to accept 3,000 child refugees who have made it into Europe unaccompanied.
But the government says the number will depend on what councils can cope with.
Funding will be made available from central government for those councils willing to take in unaccompanied child migrants, said a source.
Immigration minister James Brokenshire told a meeting of Conservative MPs he was going to write to all local councils and ask them to gauge capacity - but warn them they should expect at least as many unaccompanied children as the UK took last year.
Local authorities will be expected to share responsibility because some had been overburdened, he told the MPs.
The Local Government Association said councils were ready to "play their part" but wanted more clarity on long-term funding and how the national dispersal mechanism will work.
Save the Children said Mr Cameron had "offered a lifeline to these vulnerable children," adding: "This announcement echoes Britain's proud history of offering safety at times of great crisis and we want to thank the members of parliament who have led the way in championing this cause, as well as the British public who have opened their hearts to refugee children."
Conservative MP Heidi Allen - who had said she was prepared to vote against the government and support an amendment calling on the government to accept more unaccompanied children -  described the announcement as "tremendous news".
But a spokesman for Labour leader Jeremy Corbyn said Mr Cameron had not gone far enough - and they wanted to see "greater action and more generosity".
Labour MP Yvette Coooper, who chairs the party's refugee taskforce, said more detail was needed about what Mr Cameron is planning.
"He was wrong to claim last week that child refugees alone in Europe don't need help, so I hope he will be clear about that now and set out what the government will do next," she said.
In a letter to David Cameron, Sir Erich Reich, chairman of Kindertransport-Association of Jewish Refugees, had called on the PM to do more to help "the most vulnerable victims" of the Syrian conflict.
He said it was "incumbent on us to provide sanctuary to those in need".
Mr Cameron rejected comparisons with the "Kindertransport" scheme that helped Jewish children escape from the Nazis, at Prime Minister's Questions.
"To say that the Kindertransport is taking today children from France or Germany or Italy, safe countries that are democracies, I think that is an insult to those countries," he told MPs.
But he added: "We're going to go round the local authorities and see what more we can do, but let's stick to the principle we should not be taking in new arrivals to Europe."
In September 2015 the government said the UK would accept up to 20,000 refugees from Syria over the next five years.
And last month the government said it would accept up to 3,000 more refugees, mostly vulnerable children, from the Middle East and North Africa by 2020.
In his letter, Sir Erich, who was among thousands of Jewish children rescued from Nazi Germany, said he had learned of the rejection of the resettlement proposal "with great sadness".
He added: "I strongly urge you and your colleagues to reconsider how we can intervene to help some of the most vulnerable victims of an internecine conflict that has claimed the lives of thousands of people and displaced millions.
"The echoes of the past haunt many of my fellow Kinder and I whose fate similarly rested with members of the British parliament.
"I feel it is incumbent on us to once again demonstrate our compassion and human-kindness to provide sanctuary to those in need."
David Cameron says the UK will take in more unaccompanied Syrian refugee children from Europe, although it has not committed to a specific figure.