Like the US after 9/11, Morocco has waged a war on terror ever since bombers struck the city of Casablanca in May 2003.
On Sunday, the country appeared to have won a minor battle: Its official press agency reported that Moroccan police arrested 17 men on Nov. 11 who may belong to Al Qaeda, including two who were previously imprisoned at Guantánamo Bay.
The arrests coincided with reports published in the newspaper Al Ahdath Almaghribia that Morocco's intelligence services were concerned about a serious threat of new attacks.
But in its struggle against Islamic extremism, Morocco faces challenges unknown in the US.
To combat terrorism, the country not only risks endangering the fragile civil rights its government has begun to encourage, but it must contend with the uncertain effects of emerging moderate Islamist movements. Indeed, the rise of Islamism in politics and Moroccan society will be a difficult test of the nation's proclaimed dedication to democratic reform.
For decades, Morocco has taken pride in its relatively liberal brand of Islam. Rather than an imam, King Mohammed VI is the chief spiritual leader here, and state law is influenced but not rooted in sharia, the Islamic code.
Diversity characterizes Moroccan Islam. Women's fashions, for example, range from head scarves to miniskirts. According to a recent Pew Research Center global survey, 79 percent of Moroccans - compared with 11 percent of Jordanians and 43 percent of Pakistanis - believe violence against civilians in support of Islam is never justified.
In the late 1990s, however, reports began to appear of Salafist radicals - many of them newly returned from the Afghan war - imposing a vigilante form of Islamic law in Morocco's shantytowns, stoning women who were "inappropriately" dressed, and throwing suspected drinkers and prostitutes into wells. The Casablanca bombings, which killed 45, awakened the country to an extremism within its own borders.
"We had always told ourselves that Morocco's Islam was tolerant," says Fatiha Ladayi, Morocco's director of communications. "I was aware that fundamentalism existed here. But I didn't think that our fundamentalists were violent."
The Casablanca attacks provoked fear among Moroccans that their homeland might succumb to the rigid Islamism that had overtaken neighboring Algeria. And the world at large noted the prominent role Moroccan-born men played in terrorist strikes in Madrid, Iraq, and elsewhere.
For Mohammed Darif, a political scientist at Mohammedia's Hassan II University, the connection is clear. "There are strong ties between the attacks in Casablanca and Madrid," he writes. "They were carried out by the same organization, the [Al Qaeda-linked] Moroccan Islamic Combat Group."
Radical Islam represents a double threat to the Moroccan state - undermining the government's image of moderation and challenging its control over the faith. In response, parliament approved in May 2003 the Ministry of Interior's wide-ranging Antiterrorism Law, which in its first five months permitted the arrests of 4,000 suspected extremists.
Some believe Morocco is exploiting the terrorist threat to justify its increasing control of moderate Islamic parties. When first proposed in 2001, the antiterrorism legislation - which allows the government to monitor imams, mosques, and the religious content of textbooks, and which defines even "apologizing for terrorism" as a crime - was opposed by the Islamist Justice and Development Party (PJD). After the Casablanca bombings, however, the party backed away from its stance and the law passed.
Such acquiescence, coupled with the PJD's agreement to run in just 20 percent of 2003's local electoral contests, prompted suspicion that the party is giving in to government pressure to protect its position as Morocco's only legal Islamist party. Tremendously popular, Justice and Development won 42 seats in 2002's parliamentary elections, and because all other major parties joined Prime Minister Driss Jettou's coalition government, the PJD now functions as the opposition. Yet as the government has cracked down on Islamist extremism, the party's moderate brand of religion-based politics has come under heavy scrutiny.
In March, the government drafted a bill, the Law of Political Parties, that would ban religious (as well as regional and ethnic) references from party platforms. If it passes, the law will effectively dissolve the PJD and all other meaningful Islamist opposition.
In June, the state arrested Nadia Yassine, spokeswoman for Islamic movement Al Adl Wal Ihsan, or Justice and Charity, when she expressed her belief that Morocco would be healthier as a republic than a monarchy. In many ways Yassine symbolizes the state's Islamist dilemma: while she's a devout Muslim, married with four children, she is also a highly educated women's rights advocate who once told the BBC she believed the Prophet Muhammad was a de facto feminist.
If antagonism between the government and Islamist moderates continues, it may well cultivate further Islamic extremism. Increased political participation by moderate Islamist groups is the best way to curb the growth of extremism in Morocco, says Haizem Amirah, the senior North Africa analyst at the Royal Elcano Institute in Madrid.
"The moderate Islamists need to compete more in the political game, and form alliances with the secular groups," he explains. "That would check the radical sectors, because they would start to feel that they had less popular support, less a sense of a mission."
At PJD headquarters, vice-secretary Abdelah Baha maintains that his party can work within the existing system. "Islam and democracy can go together as global principle," he says. "Our party bases its objectives on religious principles, and then adapts them to political ends. We're like the American evangelicals."