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.