The carnage at the popular Mediterranean resort of Port el Kantaoui came the same day as a suicide bomber killed 25 people at a Shiite mosque in Kuwait and a suspected Islamist attacked a factory in France.
There was no immediate claim of responsibility for the Tunisia attack, but the Islamic State group, which marks the first anniversary of its 'caliphate' straddling Iraq and Syria Monday, said it was behind the Kuwait bombing.
Witnesses described scenes of panic after the shooting at the Riu Imperial Marhaba Hotel on the outskirts of Sousse, about 140 kilometres (87 miles) south of Tunis.
The health ministry gave the toll at 37 dead.
"There are 37 dead and 36 wounded. Some of the wounded are in a critical condition," ministry communications chief Chokri Nafti said, revising an earlier toll of 28 dead.
A spokesman for Spain's RIU group, which runs the five-star hotel, said most of the 565 guests were from Britain and "central European countries".
In Dublin, Foreign Minister Charles Flanagan said an Irish woman was among the dead.
Interior ministry spokesman Mohamed Ali Aroui told AFP 'a terrorist attack' targeted the hotel.
"The assailant was killed," he added, without ruling out the possibility of accomplices.
Secretary of State for Security Rafik Chelly told Mosaique FM the gunman was a Tunisian student 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. Then when he came to the beach he used his weapon," Chelly said.
The shooting was the worst in modern-day Tunisia and followed a March attack on the Bardo National Museum in Tunis that killed 21 foreign tourists and a policeman.
IS claimed responsibility for the Bardo attack, although Tunisia says it was carried out by an Algerian Jihadist.
Gary Pine, a British holidaymaker, said today's shooting happened at around midday (1100 GMT) when the beach was thronged.
"Over to our left, about 100 yards (metres) or so away, we saw what we thought was firecrackers going off," he told Britain's Sky News television.
"Only when you could start hearing bullets whizzing around your ear do you realise it was something a lot more serious than firecrackers." Pine said panic spread quickly.
"There was a mass exodus off the beach," said Pine, adding he heard 20 or 30 shots.
"My son was in the sea at the time and of course my wife and myself were shouting for him to get out the sea quick and as we ran up the beach he said: 'I just saw someone get shot'."
Get Breaking news, live coverage, and Latest News from India and around the world on NDTV.com. Catch all the Live TV action on NDTV 24x7 and NDTV India. Like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.