TUNIS, TUNISIA—Last Wednesday’s savage terrorist attack in Tunis targeted the one country that has delivered on the promise of the Arab Spring by producing a real—and surprisingly liberal—democracy. In every other Arab country swept by mass pro-democracy protests in 2011 and 2012, hopes have been cruelly dashed. Egypt struggles under a military-dominated dictatorship. Syria is mired in a civil war, and now Libya and more recently Yemen are sliding in the same direction. Democratic protests in Bahrain were brutally crushed by troops from Saudi Arabia and other Gulf neighbors, and nowhere else did protests reach a scale that seriously challenged autocracy.

Does the March 18 Tunis attack—which as of the latest count had taken at least 23 lives—signal that Tunisia will be the next (and final) Arab Spring state to be swallowed by violence and repression?

No. The attack was shocking and will further damage the country’s ailing tourism industry, which accounted for 7 percent of the entire economy prior to the last few years of political turbulence. But Tunisia remains full of promise. Alone among the Arab Spring states, it has achieved a remarkable level of political compromise among secular parties and the principal Islamist party, Ennahda. This has been due in no small measure to the leadership of Ennahda founder Rachid Ghannouchi, who has, at every crucial turn on the sometimes troubled path from dictatorship, embraced flexibility and moderation and promoted the vision, as he put it in a March 20 statement celebrating the country’s 59th anniversary of independence, of “a republic of freedom, democracy, and social justice.”

The Democracy Report

In marked contrast to the Muslim Brotherhood in Egypt, Ennahda agreed early last year to a remarkably secular constitution, which firmly embraces religious freedom and equality of women while rejecting language (common in many Arab constitutions) identifying Islam as a principal source of law. And when the country fell into political crisis and deadlock in 2013 following the assassinations of two liberal leaders, Ennahda agreed to surrender power to a politically neutral caretaker government that steered the country through the successful 2014 elections. The result has been the freest and fairest elections in the modern history of the Arab world, and levels of freedom, openness, and pluralism that are unknown in the rest of the Arab world.

Tunisians I’ve spoken to, from widely varying political persuasions and religious orientations, overwhelmingly reject not just the terrorism of the March 18 attacks but all forms of violence and intolerance. They are are proud of their democratic achievements and are determined not to let a small band of violent religious zealots undermine them. From the most militant secularists to the devoted followers of Ennahda, there is genuine revulsion with the violent jihadist ideology that apparently propelled the attackers, and broad concern that such terrorism could endanger the unprecedented scope of freedom Tunisians have fought so hard to achieve.

Unfortunately, however, Tunisia is in a dangerous neighborhood. Libya’s violence has radiated destabilizing effects throughout North Africa, contributing to insurgency and a military coup in Mali, the flow of arms to Boko Haram in Nigeria, and a general radicalization of alienated youth in the region. And Tunisian officials are now warning that they can never achieve true security until the deepening chaos in neighboring Libya is addressed. Two perpetrators of the March 18 shootings, who were killed by security forces during the attack, were reportedly trained in Libya. They came from a rough, impoverished part of Tunisia, in the Atlas mountain region near the border with Algeria, which experienced Islamist radicalization and severe polarization and repression during the 1990s. There is growing recognition that Tunisia—which has sent more foreign fighters to Syria than any other Arab country—must urgently address the economic and social marginalization of a segment of its youth and a section of its territory. This requires not only more effective generation of meaningful education and jobs, but also a counter-radicalization strategy that combats the allure of violent jihadist groups and gives these alienated young Tunisians a feeling of hope, dignity, and inclusion.

With its relatively high levels of education, its secular traditions, and its constitutional progress since the fall of Zine el-Abidine ben Ali’s dictatorship in 2011, Tunisia has a real chance to consolidate democracy and become an inspiration and point of diffusion for people throughout the Arab world looking for a better model of governance. But to do so, the country must revive economic growth and address high levels of unemployment, now estimated at 15 percent overall and a distressing 35 percent among youth. The challenge has become more formidable since the March 18 terrorist assault, which targeted the economically vital tourism sector. Tunisia also has a lot of work to do to improve its public security, but Tunisians I’ve spoken with are concerned that the needed enhancements of policing and intelligence not come at the expense of civil liberties and due process. International-assistance efforts must bear this in mind. The United States and Europe can be particularly helpful now in helping to improve the technology and training of Tunisian law enforcement while emphasizing democratic norms of policing and community engagement.

In its quest to become a vibrant and durable democracy, Tunisia needs and deserves help from the West. The United States and the European Union made lavish promises following Tunisia’s peaceful revolution in 2011, but most of the pledged aid never materialized. Recently, the Obama administration has proposed a significant increase in both economic and security assistance to the country. But as Nazanin Ash and Allison Grossman have recently pointed out, about half of the proposed total of $130 million is military assistance. The aid package needs to be tied to the adoption of stalled economic and administrative reforms to improve flexibility in the labor market, rein in corruption, and enhance government transparency. Such reforms could help unlock the real key to Tunisia’s economic recovery: substantially increased foreign and domestic investment. The United States should use this critical moment to appeal to the European Union to increase its assistance to Tunisia as well. Tunisia also needs and deserves closer economic integration with the U.S. and the EU through a free-trade agreement in exchange for far-reaching reform.

The best way for the United States and its European allies to respond to this latest atrocity is to say to the people and government of Tunisia, “We stand with you in this time of tragedy, and we are ready to demonstrate that in material ways.” In the wake of the terrorist attack, the country needs now—not six months or a year from now—an immediate response to specific Tunisian security needs for equipment, intelligence, and special-forces training to combat the threat.

Sometimes in history, small countries assume a strategic significance out of all proportion to their size. As the lone Arab country to move forward from popular upheaval to democracy, Tunisia is now vital to the future of the entire Arab world. The United States should bet very heavily, but smartly, on its future.