Until earlier this year, Tunisia had been considered a success story in the Arab world – a place that had emerged from the Arab uprisings of 2011 with what appeared to be a stable democracy and a secure future.
Of all the places where long-established dictatorships were swept aside by popular protests, it was Tunisia that looked like providing a blueprint for how transition in the region might work.
That illusion cracked in March when the popular Bardo Museum in Tunis was attacked by Islamist militants who killed more than 20 people, mostly European tourists. The assault on the resort of Sousse shattered it.
Both attacks aimed to undermine the gains Tunisia has made since 2011. Most crucially they sought to frighten away visitors who, in the four years since the revolution, had been persuaded to return to the resorts and beaches – their foreign cash helping to rebuild the country’s battered economy.
Friday's attack, which left at least 37 people dead, targeted popular coastal hotels, appearing again to be a deliberate attack on Tunisia’s main source of revenue.
On 18 December 2010, Mohamed Bouazizia, a young street vendor from the central town of Sidi Bouzid, frustrated by the lack of opportunities available to people like him, set himself alight in a public square. His action, and his death 18 days later, prompted protests across Tunisia that eventually led to the toppling of the President, Zine El Abidine Ben Ali, and to the sweeping tide of revolution across the region.
But if Tunisia was the birthplace of the revolution, it also appeared to be the place where its ideals held. Peaceful elections in October 2011 returned the moderate Islamist party, Ennahda. Another poll, last October, gave power to the secular Nidaa Tounes, or Call for Tunisia, party.
The government, keen to burnish the idea of stability even felt confident enough this year to launch an advertising drive to encourage the tourists back.
The social media campaign prompted people from across the globe to hold up signs carrying messages such as “Heroes! I will visit Tunisia and celebrate your Independence Day,” and “I will travel to Tunisia this summer”.
In the aftermath of the Bardo attacks in March, these signs were replaced by hashtags that echoed those that followed the attacks in Paris in January: “#JeSuisTunisien, and #PrayForTunisia soon began trending on Twitter.
In truth, Tunisia had not escaped unscathed from the tumult in the region. While exact figures are almost impossible to come by, the country is widely thought to be the single biggest contributor to the ranks of Isis. Many of the jihadists’ leading figures, who have played a role in attacks across the Middle East, are Tunisian. Two weeks ago, for example, Ali Awni al-Harzi, a Tunisian and one of Isis’s leading fixers, was killed in a targeted US air strike in Mosul, the Iraqi city held by the militants.
It was inevitable that these fighters, and those who share their ideology, would eventually return home and target Tunisia’s soft underbelly – its tourism industry.
This year's two attacks show clearly that for all Tunisia’s promise, it has been easy for the Islamists to deal a devastating blow to tourism and, as a consequence, Tunisia’s future.Reuse content