Britain is to resettle up to 20,000 refugees from Syria over the next five years, Prime Minister David Cameron has announced.

Mr Cameron told the House of Commons that the UK would live up to its "moral responsibility" towards the people forced from their homes by the forces of president Bashar Assad and the Islamic State terror group.

But he said Britain would take in vulnerable refugees only from camps in the region, and not those who have entered Europe in their thousands over recent months. This would give vulnerable people a "direct and safe" route to the UK, rather than encouraging them to make the "hazardous" journey across the Mediterranean by boat.

Mr Cameron said his decision would "show the world that this country is a country of extraordinary compassion, always standing up for our values and helping those in need".

It was described as "a very slim response" by the Archbishop of Canterbury, Justin Welby, who told the House of Lords: "It's likely it is going to have to rise over the next five years unless the driver - which is local conditions in the camps - is dealt with significantly. A problem of this scale can only morally and credibly be dealt with by widespread European collaboration."

The European Commission is understood to be preparing to ask EU member states to take part in a mandatory scheme to resettle 160,000 migrants who have already arrived in the continent.

French president Francois Hollande has said France is ready to take in 24,000 people.

But Mr Cameron indicated that Britain was not planning to participate, telling MPs that those admitted to Britain would be drawn from camps in the region according to established UN procedures for identifying the most vulnerable. Children, including orphans, are expected to be a priority.

Pressure to admit more Syrians has grown since the publication of photographs of three-year-old Aylan Kurdi, who drowned with his mother and brother trying to cross from Turkey to Greece by boat.

A ComRes poll for BBC2's Newsnight found 40% of Britons back a rise in the number of refugees admitted, against 31% who said fewer should be allowed in and 26% who thought numbers should remain as they are. Those who had seen the pictures of Aylan's body lying on a Turkish beach were significantly more likely to think Britain should accept more refugees.

Mr Cameron told the House of Commons: "The whole country has been deeply moved by the heartbreaking images we've seen over the past few days and it's absolutely right that Britain should fulfil its moral responsibility to help those refugees, just as we've done so proudly throughout our history.

"But in doing so we must use our head and our heart by pursuing a comprehensive approach that tackles the causes of the problem as well as the consequences."

He said Britain had done more than any other EU country to provide aid - now totalling £1 billion - to support refugees in Syria and neighbouring countries, and had moved quickly to provide Royal Navy ships for search and rescue missions in the Mediterranean.

The new refugees will be offered five-year humanitarian visas and the cost of their first year in Britain will be met from the Government's aid budget.

Mr Cameron said the UK was the only major country to maintain the UN's target of spending 0.7% of GDP on international aid. But he added that the upcoming Spending Review will "reshape" the way the budget is used to support Britain's national interest, increasing investment in tackling the causes of the crisis in the Middle East and north Africa and allowing much larger sums to be held in reserve to respond to acute humanitarian crises.

Commons Speaker John Bercow agreed to an application from Labour leadership candidate Yvette Cooper for an emergency debate on the refugee crisis tomorrow.

Oxfam chief executive Mark Goldring urged Mr Cameron to set out an "ambitious" timetable for completing the resettlement programme as soon as possible, warning: "This is a good step forward, but it's far from job done. With the terrible conflict in Syria showing no signs of ending, the Government should continue to review how many refugees the UK will resettle."

Justin Forsyth, chief executive officer at Save the Children, said the PM's announcement "will make a real difference to some very vulnerable families and children", but added: "We also need to help those refugees already in Europe, specifically by taking in 3,000 of the children who have travelled here completely alone. The Prime Minister could continue a proud British tradition, started by the Kindertransport, of giving lone children a second chance in Britain."

Maurice Wren, Refugee Council chief executive, said: "The programme needs to be frontloaded as the crisis is now and the expansion must happen as a matter of urgency as people are living in desperate situations in the region and cannot wait until 2020 to reach safety."

Ukip leader Nigel Farage said "most" of those arriving in Europe were economic migrants not refugees and warned there was a risk the near "stampede" could reach Britain unless it left the EU.

"The scenes that we saw at that railway station in Budapest were beginning to resemble a stampede," he told a rally to mark the start of his party's campaign for a vote to quit in the forthcoming referendum on continued membership.

"I think Europe has made a most terrible mistake mostly because most of the people who are coming are not coming from Syria, most people who are coming actually are not refugees, they are economic migrants.

"I don't want us to be part of a political union who, in the end, could impose these people on us," he told a packed meeting in Margate.

"All the Greeks have to do, all the Italians have to do, all indeed perhaps ultimately the Germans have to do, is give them their own national passports - which are EU passports - and then they can all come to Britain".

"That has got to be stopped"

He said the recent influx of new arrivals from EU states had dampened the UK's long-standing appetite for providing "genuine refuge for those who are in direct threat".