Tunisia Sousse beach attack
People pray in a circle around flowers laid in memory of the victims murdered by a gunman on the beach of the Imperial Marhaba resort in Sousse, TunisiaReuters

UK prime minister David Cameron has warned that Islamic State (Isis) militants are planning "terrible" attacks against Britain.

"There are people in Iraq and Syria who are plotting to carry out terrible acts in Britain and elsewhere and as long as ISIL (Islamic State) exists in those two countries we are at threat," Cameron told BBC radio on Monday 29 June. He also said that the fight against IS is "the struggle of our generation".

Cameron's statement came after it emerged that up to 30 British nationals have been killed on a Tunisian beach near Sousse by a gunman believed to be linked to IS terrorist group.

Home secretary Theresa May is due to travel to Tunisia to meet ministers and tourists caught up in the attack.

The prime minister ruled out a possible British military intervention in Syria and Iraq. "Our strategy is to build up local armies," he said.

Tunisia beach attack: Mourners hold vigil as British death toll rises above 30IBTimes UK

Earlier, Cameron wrote in the Daily Telegraph that Britain is "united in shock and grief" after the Tunisian beach attack.

Those identified as among the dead are: 19-year old-student Joel Richards; his uncle Adrian Evans, 49, a gas services manager from Tipton in the West Midlands; and his grandfather Patrick Evans, 78; Carly Lovett, 24, a photographer and beauty blogger; couple Sue Davey, 44, and Scott Chalkley, 42; and Lisa Burbridge from Whickham, Gateshead.

Trudy Jones, 51, from Blackwood in Gwent, South Wales was named by her local MP; while Jim and Ann McQuire from Cumbernauld, North Lanarkshire; and Bruce Wilkinson, 72, from Goole, East Yorkshire, a retired power station worker, were also killed.

Three Irish people were also killed, along with one Belgian and one German, the BBC said.