A stream of buses quietly ferried out guests who abruptly ended their beach holidays in the coastal city of Sousse.
ISIS claimed responsibility for the attack that started on the beach outside the Hotel Riu Imperial Marhaba, but it wasn't clear if the Islamist group had any direct role in it.
ISIS posted a photo of the alleged attacker, Abu Yahya al-Qirawani, 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 man featured in the ISIS photo.
Initial reports about the attack suggested there had been three gunmen, but a Tunisian Interior Ministry spokesman later said they were aware of only one and that he was killed.
The spokesman, Mohammed Ali Aroui, said the gunman was a student in his early 20s, who was going to receive his master's degree in engineering in the nearby town of Kairouan. Tunisian authorities did not name him.
He didn't have any known relationship with a terror group, Aroui said. His parents have been detained as part of the investigation.
Two U.S. officials said they believe the attack may have been inspired by ISIS, though not directed by the terrorist group.
It started on the beach
The attack unfolded over about five minutes, starting on the beach, continuing at the pool and in the lobby, and ending when the gunman was killed in the hotel's parking lot, according to Aroui.
Tunisian Prime Minister Habib Essid said the gunman hid an AK-47 machine gun under an umbrella to smuggle it onto the beach.
British tourist Ellie Makin watched him carry it.
"A guy had walked onto the beach and had dropped what I'd seen as an umbrella and underneath (it) was a massive gun of some sort and it was like in the army," she said.
"He was just firing left and right and center. I got up quick as possible ... and shouted, 'Run, there is a gun.'"
'Firing shots randomly' on the beach
Among the 38 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."
On its website, Hotel Riu Imperial Marhaba is described as an all-inclusive hotel with views of Port El Kantaoui on the Mediterranean Sea.
In the wake of the resort attack, Essid announced a crackdown on what he called "illegal mosques."
The mosques were "spreading rumors and poisons to encourage terrorism," he said Saturday "About 80 (mosques) will be closed ... within one week."
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.
And ISIS has claimed responsibility for an apparent bomb blast at the Shiite-affiliated Al-Sadiq mosque in Kuwait's capital during Friday prayers, leaving at least 27 dead and more than 200 injured.
Spain raised its terror alert in light of the three attacks, the country's 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."
ISIS had vowed museum attack 'just the start'
Terrorists have targeted Tunisia before, as part of apparent attempts to hurt the nation's economy by scaring off some of the millions who come each year to soak up its culture and visit its Mediterranean beaches.
Until Friday, the prime example had been the killing of 23 people in March at the landmark Bardo Museum in Tunis.
At the time, it was the deadliest attack on tourists in the Arab world since the 1997 massacre in Luxor, Egypt.
In a subsequent audio statement, ISIS warned that the Bardo Museum attack was "just the start."
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.
Travel groups cancel flights after attack
Some tour groups were sending extra planes to clear out tourists who wanted to leave the country before the scheduled end of their trips.
Time to reflect
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."