Tunisia has launched a crackdown on individuals described as extremists, hours after at least 38 people were killed in an attack in the coastal town of Sousse.
An armed man disguised as a tourist opened fire at the Imperial Marhaba beach hotel with a weapon he had hidden in an umbrella, on Friday.
Witnesses of the attack said the assailant took his time, targeting people at point blank range first on the beach and then around the swimming pool, reloading his weapon several times and tossing an explosive.
British, German and Belgian tourists were among the dead, the health ministry said.
The attacker was shot dead by police. Rafik Chelli, a senior interior ministry official, said he was a student, unknown to authorities and not on any watchlist.
Local radio said police captured a second gunman, but officials did not immediately confirm the arrest or his role in the attack.
It was the worst attack in Tunisia's modern history and the second major massacre this year following the assault on the Bardo national museum in Tunis when armed men killed 22 mostly foreign visitors.
Responding to the incident, Habib Essid, Tunisia's prime minister, said Tunisia plans within a week to close down 80 mosques that remain outside state control for inciting violence.
Tunisia's government had already stepped up security before the hotel attack.
I honestly thought it was fireworks and then when I saw people running... I thought, my God, it is shooting.
"Now it's talking about more police and military on the ground. But there are thousands of tourist spots and hotels. Many of them are an easy target for someone intent on killing," Al Jazeera's Nazanine Moshiri, reporting from Tunis, said.
Tunisia has been hailed as a model of democratic transition since its 2011 Arab Spring uprising and has escaped the worst of the region’s violence.
"It's held free and fair elections. It's political process has been inclusive. Religious and secular parties are in government together. But there are a minority of Tunisians who want a so-called Islamic State here. Thousands of young Tunisians are fighting for armed groups abroad," our correspondent said.
Speaking of the resort attack, Irishwoman Elizabeth O'Brien, who was staying at a neighbouring hotel with her two sons, said there was panic on the beach when gunfire erupted.
"I honestly thought it was fireworks and then when I saw people running ... I thought, my God, it is shooting," she told Irish radio station RTE. "The waiters and the security on the beach started to say 'Run, run, run!'"
|Friday's attack in the coastal town of Sousse has been described as the deadliest in Tunisia's modern history [AP]
In Sousse, many tourists were already packing their suitcases into buses and checking out of hotels to leave after the attack, Reuters news agency reported.
German tour operator TUI said it was organising flights for tourists wishing to return from Tunisia and said those who booked Tunisian holidays for this summer could rebook or cancel the trips free of charge.
Sousse, alongside nearby Hammamet and the island of Djerba, is the heartland of Tunisia's most popular beach resorts, drawing visitors from Europe and neighbouring North African countries like Algeria.
Six million tourists, mostly Europeans, visited Tunisia's beaches, desert treks and medina souqs last year, providing seven percent of its gross domestic product, most of its foreign currency revenues and more jobs than anything but farming.
"This is a catastrophe for the economy," Salma Loumi, Tunisia's tourism minister, said.
"Our losses will be great, but the loss of human life was even greater."
Source: Al Jazeera and agencies