Tunisia's health ministry said it had identified the bodies of 17 people from Britain, Germany, Ireland, Belgium and Portugal, as it tried to establish the identities of victims mown down in their beachwear.
British police have sent forensic experts and detectives to Tunisia to help identify victims and gather evidence.
The assailant pulled a gun hidden inside a parasol and opened fire on tourists on the sand and by a pool, in the deadliest attack in Tunisia's recent history.
Prime Minister David Cameron warned that Britain needed to prepare "for the fact that many of those killed in the attack were British".
He added: "These were innocent holidaymakers, relaxing and enjoying time with their friends and families."
The shooting followed a March attack claimed by IS on Tunis's National Bardo Museum that killed 21 foreign tourists and a policeman.
"It's very painful," said Alya, who lives in nearby Sousse. "The wounds were still healing from the Bardo attack, and now we've been dealt an even bigger blow."
Another 39 people including 25 Britons, seven Tunisians and three Belgians were wounded in the attack, the health ministry said.
Tunisian Prime Minister Habib Essid said from next month armed guards would be deployed all along the coast and inside hotels.
- Fears for future -
But Tunisians who rely on tourism fear it will come too late.
"If I were in their shoes, I wouldn't set foot in Tunisia right now," said Imed Triki, a shopkeeper in Sousse.
"After this catastrophe, it's normal that they leave the country so quickly. Do they come here on holiday or to die?"
Late Saturday, at least 200 protesters gathered in a demonstration called by the leftist Popular Front coalition in the heart of the capital Tunis to denounce the attack.
"The victims (of the attack) are my brothers and sisters in humanity," said Karima Benhajj, a blue-eyed, 30-year-old woman at the protest.
The jihadist attack came on the same day that 26 people were killed at a Shiite mosque in Kuwait and a suspected Islamist attacked a factory in France.
The attacks came days ahead of the first anniversary of IS declaring its territory in Iraq and Syria a "caliphate".
Tunisian Secretary of State for Security Rafik Chelly told Mosaique FM the gunman was a student previously unknown to the authorities.
"He entered by the beach, dressed like someone who was going to swim, and he had a beach umbrella with his gun in it," Chelly said.
- Targeting tourists -
Witnesses described scenes of panic after the shooting at the hotel on the outskirts of Sousse, about 140 kilometres (90 miles) south of Tunis.
One young Tunisian told police that the gunman fired only at tourists.
"The terrorist told us: 'Stay away, I didn't come for you'," he said.
"He did not fire at us -- he fired at the tourists."
Many questioned the ease with which the gunman entered the resort.
"What happened is the sign of security failures," said Rached Ghannouchi, who heads the country's second-biggest political party, the Islamist Annahda.
But hotel owner Zohra Driss told a news conference its guards were unarmed and unable to confront "someone with a Kalashnikov."
- Tightened security -
Prime minister Essid said a raft of new anti-terrorism measures would take effect from July 1, including the deployment of reserve troops to reinforce security at "sensitive sites... and places that could be targets of terrorist attacks".
The government would also close 80 mosques suspected of fanning extremism, he added, echoing his predecessor's calls to shut down "illegal" mosques.
But tour operators scrambled to fly thousands of fearful holidaymakers home.
Overnight, 13 airliners took off from Enfidha airport north of Sousse.
Travel companies Thomson, First Choice and Jet2 said they had repatriated some 1,200 clients on Saturday and that they planned to fly home a total of 2,500 by the end of Sunday.
Belgian travel agency Jetair has also flown home 1,200 of its clients, and by Sunday that number should rise to 2,000.
About 20,000 British tourists are currently on package holidays in Tunisia, according to ABTA, the country's largest travel association.
Tourism accounts for seven percent of Tunisia's GDP and almost 400,000 direct and indirect jobs.