The fight against Islamic State is “the struggle of our generation”, David Cameron has said, as it emerged the British death toll in the Tunisian attack will rise above 30.
Home Secretary Theresa May will travel to Tunisia on Monday to meet ministers and those caught up in the attack.
A total of 38 people were killed on a beach near Sousse by a gunman with links to Islamic State extremists.
Mr Cameron said IS could be beaten but it would take “a very long time”.
The prime minister told BBC Radio 4’s Today programme the “absolutely horrific” events had “shocked the whole of the world”.
He said IS posed “an existential threat” to the West, and its members in Iraq and Syria were plotting “terrible attacks” on British soil.
Mr Cameron – who will chair another meeting of the Cobra emergency committee on Monday morning – said the UK must have a “full-spectrum response” to the IS threat – including continuing with air strikes.
Asked if British troops were needed on the ground, he added: “Our strategy is to build up local armies. It’s much easier to just invade a country… it’s easier and faster, but that has consequences.”
The PM also said an RAF C17 transport plane would be sent to Tunisia on Monday to help evacuate casualties, and if families wished, aircraft could help return their loved ones’ bodies to the UK.
Tributes are continuing to be paid to the British victims, who include three generations of the same family, university graduates and a husband who died trying to shield his wife.
A number of British tourists remain missing, with their relatives continuing to face an agonising wait for news.
Tunisia beach attack: The victims
The names of those killed in the attack are slowly emerging. Here’s what we know so far about those who lost their lives.
The BBC understands the number of British victims – which currently stands at 15 – will rise to at least 30 once the formal identification process is complete.
Most of the dead have not been officially identified, with most details so far coming from friends and family. Suffolk Police, however, have confirmed that 52-year-old Stuart Cullen, from Lowestoft, was among those who died.
Three Irish people were also killed, along with one Belgian and one German, and Tunisians are also thought to be among the dead. At least 36 people were injured.
But it is also understood the process is taking time because of strict Tunisian regulations, including the local coroner’s requirement for medical or dental records.
The UK government also suggested officials were having difficulty identifying British victims as many were not carrying identification and because the injured were being moved between hospitals.
Mr Cameron said UK air strikes against IS in Iraq were having an effect even if they made Britain a target.
“I think that frankly, we are a target. They have declared war on us, they are attacking our people at home and overseas whether we like it or not… They are attacking our way of life and what we stand for.
“There are people in Iraq and Syria who are plotting to carry out terrible acts in Britain and elsewhere and as long as ISIL exists in those two countries we are at threat.”
The PM likened the fight against IS to that against communism: “It’s a battle of our values and our narrative against their values and their narrative. We have to get that right as well as the military end of things.”
He said it wasn’t enough to “destroy [IS] at source”, adding: “We have to deal with this appalling radical narrative that’s taking over the minds of young people in our country.”
BBC political correspondent Robin Brant
He doesn’t say it overtly but this is another message to Muslims here and abroad.
With the knowledge that nearly all the victims on that beach in Tunisia were British, David Cameron says: “We must be more intolerant of intolerance” when it comes to extremist views.
The prime minister calls for a rejection of “anyone whose views condone the Islamist extremist narrative”.
That is more direct than his words in a speech 10 days ago, when he criticised some British Muslims whom he said “quietly condoned” the actions of groups like Islamic State – but he’s not suggesting any new quick fixes or a change to policy.
There is politics though; he says social media online is the primary weapon of Islamic State and he reminds people of the controversial new interception powers the government wants to give the police and security services, saying they must have them to “root out this poison”.
The UK has a team of more than 50 consular staff, police officers and experts from the Red Cross on the ground in Sousse.
Detectives from the Met Police are among officers there helping with the investigation into the deadliest single terrorist attack on British people since 52 were killed in the London bombings of 2005.
Attacker ‘had help’
Some 3,500 British tourists have flown home from Tunisia since Friday’s attack.
Salman Sayed, Thomas Cook’s UK managing director, said anyone booked to travel there up until 12 July could cancel if they wished, and anyone due to travel before 31 October could amend their trip, including changing to another country.
Some holidaymakers have criticised tour operators’ response to the attack, but Mr Sayed told the BBC the company was doing its best in an “extraordinary” situation.
“We brought in additional staff immediately from Turkey and deployed them in our resorts. We have also deployed the maximum number of people we could over the weekend in our contact centres in the UK,” he said.
The Tunisian authorities have said they believe the gunman, 23-year-old Seifeddine Rezgui, had help in carrying out the attack.
They believe the suspected accomplices provided the Kalashnikov assault rifle to Rezgui and helped him get to the scene, interior ministry spokesman Mohamed Ali Aroui told AP.
He said the attacker’s father and three friends he lived with in Kairouan, where he studied, had been detained for questioning.
Holiday firms put on extra flights over the weekend for people wanting to return home. Flights to the country have also been cancelled.
Meanwhile, the Foreign Office has updated its travel advice to warn that further terrorist attacks in Tunisia are possible, and urged people to be vigilant.
The Tunisian government has brought in increased security measures, and the country’s UK ambassador told the BBC armed police would be deployed to protect tourist beaches.