At least five Britons are among the dead after an attack on a beach near the popular Tunisian resort town of Sousse, Foreign Secretary Philip Hammond has said.
Tunisia's health ministry has said at least 39 people are dead, mostly foreigners.
The UK death toll could rise, Mr Hammond said, with a "high proportion" of casualties expected to be British.
Tunisian officials say one gunman was shot dead and another is being pursued.
They said one attacker, who had posed as a swimmer but was carrying a rifle under a parasol, was shot dead in an exchange of fire with police.
Local media reported that a second attacker had been arrested, but this has not been confirmed.
Tunisians, Germans, Belgians and at least one Irish citizen are among the dead. A further 36 people are injured, the health ministry said.
Tourists described "bullets whizzing around us" and scenes of "panic" at the Port El Kantaoui district.
A number of people have posted appeals on Twitter for information about relatives who have not made contact since the attack.
Day of attacks
The shooting in Tunisia comes on the same day as:
Mr Hammond said: "The situation on the ground is still somewhat confused and we can't be sure exactly how many, but because of the nature of the composition of the tourist population in this part of Tunisia we have to assume that a high proportion of those killed and injured will have been British."
Prime Minister David Cameron said: "I have called the Tunisian President to offer my support. We stand shoulder to shoulder in the fight against terrorism."
The UK's terror level remains at severe. But police are putting in place additional security measures for events this weekend, including Armed Forces Day and Pride London.
A man from south Wales is believed to be among the injured.
Saera Wilson said her fiancee, gas engineer Matthew James, 30, from Trehafod, near Pontypridd, was trying to protect her when the gunmen opened fire.
Ms Wilson, 26, said Mr James, known as Sas, was hit in the shoulder, chest and hip.
An Irish woman in her 50s is among the dead, the Irish government confirmed. The woman from County Meath, named locally as Lorna Carty, was on holiday with her husband who made contact with the Irish consular authorities.
Ireland's Minister for Foreign Affairs Charlie Flanagan said he could not rule out the possibility that other Irish people had also been killed.
Earlier, a statement from the Foreign Office said gunmen attacked the Imperial Hotel and Hotel Club Riu Bellevue at Port El Kantaoui.
It added that some attackers may still be at large and urged those nearby to remain indoors, and contact their tour operator and the Foreign Office on 020 7008 0000.
"For security reasons they should not advertise their location on social media or when speaking to journalists," the statement added.
Mr Hammond said the travel advice issued in the wake of an attack in Tunis earlier this year was "appropriate", but would be kept under "constant review".
Abta, the Association of British Travel Agents, said around 20,000 visitors were currently on holiday with Abta members in Tunisia but added that there will also be a number of holidaymakers who have travelled independently.
Debbie Horsfall, from Huddersfield, was on the beach with her friend when the shooting began.
She said: "My friend stood up and saw a man with the gun firing. We got up and ran, but we didn't know where to go."
Steve Johnson was also on the beach when the attack began. He says he tried to make sure others were safe until police arrived.
He told the BBC: "We shouted to everybody around us who joined the sort of mass rush from the beach and we ended up in the spa area of the hotel where we sort of tried to organise people to get themselves concealed away from windows, got the staff to lock all the doors.
"We stayed there until we started to see armed police officers and waited until we were told it was safe to come out."
Gary Pine, from Bristol, who is on holiday with his wife and son at the El Mouradi Palm Marina hotel, said he had been on the beach with his family about noon when he heard a sound he initially thought was firecrackers.
"It seemed to be happening 150 yards to our left. The people in the direct vicinity of the incident were breaking in all kinds of different directions.
"There was confusion. No-one knew what seemed to be breaking out. My wife was shouting to my son to get out the sea, and as he ran up the beach he said 'I just saw someone get shot'."
A meeting of the UK government's emergency Cobra group took place in London, chaired by the foreign secretary.
Speaking in Brussels earlier as news of the attack emerged, the prime minister said: "We have got to do all we can to help.
"That means co-operating on counter-terrorism, building our capacity on counter-terrorism, it means dealing with the threat at source whether that is Isil [also known as Islamic State] in Syria and Iraq or whether it is other extremist groups around the world."