On September 19, Tunisia announced a one-month extension of the state of emergency that has been in place since November of last year, when a suicide bombing by Daesh killed 12 members of the presidential guard in the heart of Tunis. The state of emergency empowers the government to ban strikes and meetings, temporarily close theaters and bars, and impose controls over the press. It comes in response to a recent spate of attacks that include not only the November attack but also the murder of 39 mostly British tourists gunned down on a beach in Sousse.

Tunisia represents the only true success story to emerge from the Arab Spring, but there is no denying that the country has been plagued by jihadists and ongoing economic strife. Of late, even tensions over a growing water crisis have been enough to spark strikes and protests. Terrorist attacks, especially those which target tourist hotspots, strike directly at the soft underbelly of a society trying to piece together a new democratic order. Both Tunisian officials and the jihadist groups trying to undermine them know that tourism accounts for 8% of Tunisia’s GDP.

Before Sousse, Daesh targeted the Bardo Museum in Tunis and killed 20 foreign visitors. These attacks have shattered Tunisia’s longstanding reputation as a vacation destination for European travelers. In the first five months of 2016, the number of British tourists visiting Tunisia had already dropped by 93%, and from 2014 through 2015, Tunisian income from tourism fell 35%. With reservations plummeting, 70 hotels closed their doors just between September and October of last year. The hope and optimism that followed the Arab Spring, which overthrew the dictator Zine el-Abidine Ben Ali and installed a democratic government, seems to have dissipated.

The new pluralism of post-Arab Spring Tunisia has made the nation a target for fundamentalist extremism. This is no accident; for Daesh, al-Qaeda, and other groups who gained legitimacy and attracted recruits by opposing secular autocrats like Ben Ali, Tunisia’s democratic experiment threatens to fatally undermine their argument that fanatical Islamism is the only viable approach to governing the Arab world. If democracy thrives in Tunisia, it can take root throughout the region. Where citizens can rely on an accountable government and remove corrupt leaders at the ballot box, the jihadists’ message will fall on deaf ears.

Knowing the havoc they can wreak by targeting foreigners, jihadists have not shied away from attacking tourists elsewhere. Egypt has faced a similar crisis since its own uprising against Hosni Mubarak, and many airlines cancelled their flights to the popular resorts of Sharm el-Sheikh after a Russian jetliner was shot down last October. Syria, once a top tourist destination in the Arab world, has been torn apart in equal measure by Bashar el-Assad’s regime and Daesh. Recently, the Syrian ministry of tourism released a cynical, disturbingly misleading advertisement to promote tourism in Syria, glibly ignoring the bloody realities of a country whose onetime economic capital, Aleppo, is even now being reduced to ruin.

With more than ten million Syrians displaced, the “Syria Is Always Beautiful” campaign is not only a macabre reminder of Assad’s disconnect with reality but also a sad echo of how inviting of a destination Syria was before the war began. Even Turkey, with its NATO membership and regional economic clout, has seen its stream of tourists dry up in the face of ongoing war with both Daesh and the Kurdistan Workers’ Party (PKK) and the abortive coup against President Erdoğan.

Until recently, Tunisia, Egypt, Syria, and Turkey had all been able to rely on the crowds of European and other tourists visiting their shores to bolster economic growth, attract foreign currency inflows, and provide job opportunities for locals. As these traditional hubs fall prey to instability, other Middle Eastern countries that have traditionally not had to trouble themselves with those challenges have started seeing the tourism industry as a potential remedy to their own, somewhat different economic troubles.

Members of the Gulf Cooperation Council (GCC), including the United Arab Emirates and Saudi Arabia, had until recently been able to rely on lavish energy revenues to fund their state budgets and prop up generous social welfare systems. With those revenues dropping, however, the Gulf emirs are now looking at the tourism industry as part of broader programs to diversify oil-dependent economies. Tourism in the GCC nations, fueled by hotspots like Dubai and the millions of devout Muslims that visit Saudi Arabia every year, is already on track to become a $37 billion industry by 2020.

Saudi officials, for their part, are now loosening restrictions on visitors and expanding infrastructure between urban centers to encourage more non-Muslims to visit the country. The prohibition on alcohol, gender segregation, and strict adherence to sharia makes the country an unorthodox vacation destination, but King Salman and his son Mohammed are intent on attracting more foreign visitors as part of their “Vision 2030” economic plan. The government plans to invest $46 billion in tourism by 2020, developing coastal attractions and archaeological sites to create badly-needed jobs for young Saudis.

That Westerners might come to see Saudi Arabia as a travel destination may not be so far-fetched. The country is already home to 26,000 British expats and even more Americans, and though its economic ties with these two partners has been limited to a few sectors (such as energy and defense), Mohammed bin Salman has been lobbying hard to attract greater Western investment. British and American businesspeople are well-accustomed to working in the Kingdom, particularly those consultants currently supporting Salman’s reforms. Wealthy Saudis are known for traveling to London to show off expensive cars and shop for designer brands; with British tourists are clearly unwilling to travel to Tunis after Sousse, economic planners in Riyadh hope they can make that exchange more of a two-way street.

In the UAE, Dubai’s ability to flourish as a magnet for foreign visitors and capital offers a stunning example of just how much can rise out of seemingly barren desert. In a process that began with the young Sheikh Mohammed (now emir of Dubai) taking over the international airport of the then-sleepy city in 1974, the creation of the Emirates airline brought in foreign tourists and eventually tens of thousands of high-income expatriates from the United Kingdom and other Western countries.

Land reforms in 2002 allowed these foreigners to purchase land for the first time in any of the Gulf states, and an ensuing boom saw the city’s population double between 2002 and 2008. By creating a local version of special economic zones (where, critically, strict sharia business codes would not apply), Sheikh Mohammed attracted major multinationals to set up their business operations in Dubai. Since then, the success of Dubai’s tourism industry seems to justify this wholesale transformation, with over 15 million expected visitors spending $31.3 billion dollars this year alone.

The Gulf states may well succeed in making their countries (and not just Dubai) into travel destinations for both Muslim and non-Muslim visitors. Their slice of the Middle East boasts considerable untapped potential in terms of its history, natural beauty, and safety (at least when compared to the rest of the region). More sobering, however, is the series of conflagrations that has left such a large share in this critical market open to them. Jobseekers in the Gulf might reap the benefits from new visitors, but one can only wonder what happens to the countless Tunisians, Egyptians, and Turks whose livelihoods depend on outsiders who are no longer willing to come.