The Islamist group named the attacker as Abu Yahya al-Qirawani and said he managed to infiltrate the Hotel Riu Imperial Marhaba in the coastal city of Sousse.
ISIS posted a photo of the alleged attacker, but people who were at the scene of the shooting told CNN they could not definitively say whether the gunman they saw is the same one featured in the ISIS photo.
Some witnesses reported seeing more than one gunman, and the Tunisian Interior Ministry initially said there had been three, but a ministry spokesman later said they are aware of only one and that he was killed.
The spokesman, Mohammed Ali Aroui, said the gunman was a student who was going to receive his master's degree in engineering in the nearby town of Kairouan. Tunisian authorities did not name him.
Two U.S. officials said they believe the Tunisia attack may have been inspired by ISIS, though not directed by the terrorist group.
The 'swoosh of bullets' on the beach
Tunisian Prime Minister Habib Essid said 38 people were killed, many of them as they enjoyed their holiday on the beach.
Among the dead were at least five Britons, three Belgians, one German, and one woman from Ireland, according to the foreign ministries of Britain, Ireland and Tunisia.
An unknown number of French nationals were also among the dead, Essid said Saturday, according to CNN affiliate BFMTV.
A British man wounded in the arm described running into the sea to escape.
"I heard someone firing a gun and then I looked at my wife, and she got up and ran," the man, whose name wasn't given, told Tunisia's Watania 1 TV.
"As I turned, the bullet just hit me in my arm. ... My wife ran to the hotel and I just saw the gunman firing shots randomly at people laying on the sunbeds on the beach."
Another British tourist staying next door to the Imperial Marhaba said he had just left its lobby and was walking along the beach with his wife when the firing started.
Ian Symes said that at first it sounded like fireworks, but "then you could hear the swoosh of the bullets as they were going on the beach, and that's when panic set in and everybody rushed up to the hotels."
He said he also heard a couple of explosions amid the gunshots, which he believes might have been grenades.
A woman from Wales told CNN's Robyn Kriel that she saw bloodied bodies lying in the sand and people from neighboring hotels jumping over fences to get to her hotel, about a mile away from the main attack scene.
The woman said she heard at least 30 seconds of sustained gunfire.
Symes said staff from the hotel ran onto the beach while the firing was still going on so they could help the victims.
"They were very brave," he said. "They were going toward (the victims), certainly while the guns were still firing. Very commendable."
On its website, Hotel Riu Imperial Marhaba
is described as an all-inclusive hotel with views of Port El Kantaoui on the Mediterranean Sea. It contains indoor and outdoor pools, including one for children, as well as buffet-style and theme restaurants.
Attacks also in France, Kuwait
Tunisia's nightmare came on the same day as at least two fatal terrorist attacks
in other countries.
A man caused an explosion at a chemical plant near Lyon
in southeastern France after having beheaded his boss and leaving the head hanging on a fence, French officials said. Authorities detained the suspect.
Spain raised its terror alert -- to 4 on a 1-to-5 scale, with the higher numbers indicating a bigger threat -- in light of the three attacks, Spanish Interior Minister Jorge Ferandez said. Other leaders, like British Prime Minister David Cameron, reacted as well.
"I am sickened by the attacks in Tunisia, France and Kuwait," Cameron tweeted. "Our countries stand together in combating the horrors of terrorism."
Sajjan Gohel, the international security director for the Asia-Pacific Foundation think tank, said the confluence of events add up to "an unprecedented day for terrorism." He noted that, while questions remain about who was responsible and the extent to which the attacks were coordinated, in each case you have individuals "buying into the ... doctrine that groups like ISIS articulate."
While what happened Friday is rare, Gohel told CNN that people worldwide should brace themselves for more such violence.
"Terrorism is something that, unfortunately, we're going to have to accept as part of our daily lives," said Gohel, who is also an Islamist ideology expert at the London School of Economics. "Terrorism is now diffuse: It's not autonomous, it's not necessarily being coordinated by one particular group, (and) it can often be very spontaneous.
"... Gone are the days of the al Qaeda large-scale plots where the cell was big, the authorities could disrupt it, arrest (people) and prosecute. Now are are seeing an increase in the volume of terrorism because the plots sometimes actually are on a smaller scale (which makes them) harder to protect, harder to monitor."
ISIS had vowed museum attack 'just the start'
Tunisia is the birthplace of the Arab Spring
and perhaps its lone success story. But the North African nation is not without its issues, including an uneven economy marred by high unemployment and the distinction of having more citizens -- up to 3,000 -- thought to have gone to Iraq and Syria to fight as jihadists, according to the London-based International Centre for the Study of Radicalization.
Terrorists within Tunisia have been targeted before, as part of apparent attempts to hurt Tunisia's economy by scaring off some of the millions who come each year to the country for its culture and Mediterranean Sea beaches.
The prime example, until Friday, had been the killing of 23 people -- most of whom vacationing aboard two cruise ships -- last March at the landmark Bardo Museum in Tunis.
At the time, that attack was the deadliest on tourists in the Arab world since the 1997 massacre in Luxor, Egypt.
In a subsequent audio statement, ISIS identified two men
-- Abu Zakariya al-Tunisi and Abu Anas al-Tunisi -- who it said used "automatic weapons and hand grenades" to kill and injure what it called "crusaders and apostates."
That message also warned that the Bardo Museum attack was "just the start."
Friday's hotel attack will do nothing to calm fears about more violence, especially for tourists.
Belgian carrier JetAir not only canceled all its flights to Tunisia in the wake of this new violence, but had one flight turn around mid-flight and return to Brussels. And TUI tour operators Jetair, Sunjets.be and VIP Selection have canceled all departures to Tunisia until further notice.
And Tunisians themselves looked inward once again, forced to face the scourge of terrorism and figure out what to do next.
"Tunisia has undergone a remarkable democratic transition and is the success story of the Arab Spring. But our country is still fragile," said the Ennahda Party, a moderate Islamic group that's part of Tunisia's coalition government.
"There is a tiny but poisonous fringe of society across our region which has wrongly interpreted the Islamic faith and wishes to destroy Tunisia's progress, at any cost. ... Today's attack will not weaken the commitment of Tunisians and people around the world to the values of democracy, equality and the fundamental importance of human life."