In the final moments of Tunisia's worst terror attack in history, witnesses recalled, the assailant casually strolled to the ocean at a popular resort to wash his hands and face.

Moments earlier, they said, the man later identified by authorities as Seifeddine Rezgui had been methodically stalking mostly European tourists with an assault rifle and grenades.

In a half-hour rampage Friday that shocked the world for its brutality, Rezgui killed 39 people and wounded dozens as they sunbathed on a pristine beach in Sousse.

READ ALSO: IS claims Tunisian beach resort massacre: statement

READ ALSO: Tourists scramble to leave Tunisia after seaside massacre

READ ALSO: Britain mourns at least 15 dead in Tunisia attack

But as he finished cleansing himself, Rezgui turned toward a group of nearby Tunisian hotel staff who were frantically dragging wounded beachgoers away from the violence.

"He fired his Kalashnikov into the air and yelled, 'Run! Get away! I'm not here to kill you!" said Ibrahim Ghrib, 23, a lifeguard, who witnessed the encounter.

To Ghrib, the message was clear. The Western tourists who used to pack this tiny Mediterranean country's placid beach resorts are no longer welcome, at least not by the Islamic extremists who seem to hold increasing sway here.

Friday's attack at the Imperial Marhaba hotel grounds was carried out with a ruthlessness associated with the Islamic State, which increasingly appears to threaten the politics of moderation that have steered Tunisia on a democratic path after a revolution.

Shortly after the killings Friday, the extremist group that controls swaths of Syria and Iraq claimed responsibility for the assault, identifying Rezgui as Abu Yahya al-Qirawani, a nom de guerre. Not long after the attack, law enforcement officers shot dead the 24-year-old Tunisian national.

On Saturday, Tunisia's prime minister, Habib Essid, announced a series of security measures in response to the attack, including the closure of dozens of mosques linked to extremists.

But that did not calm the nerves of tourists in Sousse, about 90 miles south of Tunis, the capital, who scrambled Saturday to leave for their home countries. Special flights to Europe were organized for vacationers at a nearby airport.

Tobias Ellwood, Britain's Minister for the Middle East affairs, said Saturday at least 15 British national were killed in the attack. Other nationalities of people killed in the incident include German, Irish, Belgian and Portuguese, as well as Tunisian.

During the Friday attack, which started just before noon, witnesses described scenes of chaos and carnage.

Ghrib, the lifeguard, said that he was on duty at the nearby Palm Marina hotel beach when he first saw Rezgui walking along the water several meters away holding a red umbrella and wearing a black shirt and black swim shorts. He said that Rezgui then dropped the umbrella, used to conceal an assault rifle, and began opening fire on dozens of people lounging on beach chairs.

"I immediately started shouting at people on the beach to run to the hotel," Ghrib recalled.

Waves of vacationers began running for safety, many of them covered in blood as they streamed into the patio restaurant of the nearby Palm Marina hotel. The hordes of screaming people startled Mandy Morris, 52, a Briton who initially mistook the cackle of gunfire for fireworks.

tunisia
At least 37 people were killed and 36 wounded when a gunman opened fire on holidaymakers at a Tunisian beach resort hotel, the health ministry said. - AFP PHOTO / BECHIR TAIEB

Shortly before incident, she said, she noticed a small boat racing to shore and away from the other recreation boats in the water. A few moments later, she began hearing automatic-weapons fire, she said.

"I'm still suspicious of who was on that boat. It just came straight to shore," said Morris, who fled for cover with her husband in the Palm Marina.

Alexander Nicolai, 48, recalled seeing the same boat drop two people on the beach next to him. The shooting started as the men jumped off the boat, which he described as a rubber dingy. But he said he could not determine whether the men on the craft were actual assailants.

It is still unclear whether Rezgui had accomplices in the attack.

On Friday evening, Mohammed Ali Aroui, an interior ministry spokesman, told Tunisian television that law enforcement were pursuing another suspect in the killing, although he declined to provide details. Contacted by telephone, an official at the interior ministry said Saturday one suspect had been arrested. Citing a lack of authorization, the employee, who declined to give details, spoke on condition of anonymity.

Diane Darlington, 21, said she and a friend thought they heard gunfire from three different locations near the site of the attack. They ran for cover in their fourth-floor room at the Palm Marina, where they watched events at the beach.

"We're certain there were three of them," said Darlington, a Briton from York.

Shams Eddine Bowmaffeh, who works at the Palm Marina pool area, remembered seeing only one assailant, Rezgui. After helping tourists take cover in the hotel, Bowmaffeh, 20, recalled running toward the Imperial Marhaba beach to check on wounded tourists.

By then, he said, Rezgui had left the beach and entered the Imperial Marhaba, attacking the hotel pool area with at least one grenade. Rezgui then entered the reception at the Imperial Marhaba, opening fire with the assault rifle, which was reloaded multiple times during the rampage, witnesses said.

About 30 minutes into the incident, Bowmaffeh said, Rezgui walked back to the beach area of the Imperial Marhaba. At that moment, Bowmaffeh was helping lifeguard Ghrib and about a dozen other hotel staff pull wounded tourists off the beach.

They all paused in disbelief as the killer washed his body before firing his weapon into the air and warning them to leave, Bowmaffeh said. Then Rezgui walked northwards along the beach, somewhere afterward meeting his fate with Tunisian police.

"He washed himself calmly, like he hadn't just killed dozens of innocent people," said Bowmaffeh. "It was pure evil."