Morocco’s rippled sand dunes, sheltered coves and white sand beaches have long lured tourists looking for a taste of the Maghreb without compromising security. The narrow country, which borders the Atlantic Ocean and the Mediterranean Sea, has been hailed for years as a success story in the Arab world and the last safe haven in North Africa. But a surge in Islamic State group supporters is threatening that stability.

With a Muslim majority population, high youth unemployment and its proximity to territory held by the Islamic State group in Libya, Morocco is facing a rising threat of Islamic radicalism and terrorism at home that could shatter its image as trouble-free. A growing number of Moroccans are joining ISIS on the battlefield in Iraq and Syria, while several hundred others have traveled to Libya in recent months. Terrorism and political experts said these Moroccan fighters pose a threat to the greater Maghreb region as well as nearby southern Europe because they could mount attacks upon returning home.

“Morocco is a natural candidate,” Max Abrahms, an expert on terrorism in the Middle East and North Africa and an assistant professor of political science at Northeastern University in Boston, said. “There are a lot of conditions there that favor growing terrorism problems.”

Like many other countries in North Africa, Morocco is fertile ground for ISIS recruitment. Its population is almost entirely Muslim, accounting for more than 99 percent of the population, and the vast majority is Sunni. The terrorist group, also known as ISIS or ISIL, follows an extremist interpretation of Sunni Islam. 

Meanwhile, a swelling number of Moroccan youth are out of work and rural poverty is rampant. The unemployment rate reached 10.1 percent in the third quarter of 2015, a 0.5 percent increase compared to the same period in 2014. Youth unemployment was more than double that figure at 21.4 percent, according to recent data issued by an independent government statistical institution in Morocco. North Africa has had the highest rate of youth unemployment in the world for decades.

Prophet Mohammed parade in Morocco Traditionally dressed Moroccan men take part in a parade in Sale, marking the anniversary of the birthday of Islam's Prophet Mohammed on Dec. 23, 2015. Photo: Fadel Senna/AFP/Getty Images

Still, Morocco has remained relatively terror-free — compared to its North African neighbors — with preemptive policies and counterterrorism efforts. There are departments within the religious affairs ministry that oversee the country’s 50,000 mosques and strictly monitor religious education to curb the spread of radical ideologies. The North African kingdom also is working closely with its allies, particularly the United States, Spain and France, to jointly fight global terrorism.

Following the Nov. 13 attacks in Paris, which killed 130 people and were claimed by ISIS, Moroccan intelligence helped French police track down Abdelhamid Abaaoud, a Belgian national of Moroccan descent who allegedly was the mastermind behind the terror attacks. Moroccan authorities have also been holding Abaaoud's brother Yassine since October and have issued an arrest warrant for Salah Abdeslam, a Belgian-born Moroccan-Frenchman who is suspected of taking part in the Paris attacks and is still at large, according to Reuters.

“Morocco faces many of the same socio-economic challenges and drivers of radical ideology that many other countries in the region face,” said Haim Malka, senior fellow and deputy director of the Middle East Program at the Center for Strategic and International Studies, a Washington think tank. “What’s different about Morocco is that it has a strong executive authority, namely the king, who controls the security forces and sets security policy.”

Terror threats in Morocco, however, have become more frequent in recent years as Islamic radicalism has spread throughout North Africa. The country suffered the deadliest terror attack in its history in 2003, when a dozen suicide bombers detonated four different places in Casablanca and killed 33 civilians. And since 2011, at least 1,500 Moroccans have joined the Islamic State group to fight in Iraq and Syria, where the Salafi jihadist militants control swaths of territory. Some 300 others have left for Libya, where ISIS has exploited a power vacuum to solidify its foothold. The Islamic State group has also successfully launched attacks in nearby Tunisia, threatening to topple the country’s fledgling democracy.

Terrorism and political experts warned that radicalized Moroccans could launch attacks or recruit jihadists at home or even in southern Spain, which is narrowly separated from Morocco by just 8 nautical miles. Morocco also shares a western border with the Spanish territory of Ceuta.

“The jihadist hub in Libya, which is attracting Moroccans, Tunisians and others, is a major challenge that is increasingly difficult for Morocco to insulate itself from,” Malka added.

Spain to Morocco ferry Motorists and passengers embark on a ferry to Tangier, Morocco, from the Spanish port of Algeciras on July 31, 2015. Thousands of Moroccan nationals working and living in Europe regularly pass through the narrow Strait of Gibraltar as they return to spend vacations in Morocco. Photo: Jorge Guerrero/AFP/Getty Images

Morocco, whose economy depends heavily on tourism, has ramped up its counterterrorism activities in response. Moroccan police are regularly dismantling terror cells and arresting supposed militants. Most recently, seven suspected terrorists who allegedly had received training from ISIS in Syria and were planning attacks on Moroccan soil were arrested Jan. 8 in Casablanca. But the problem with stepping up these efforts is that it could result in arbitrary arrests and inadvertently fuel radicalism by causing greater dissent among the already disaffected Muslim youth. It might also panic much-needed tourists, according to terrorism and political experts.

"I think Morocco is walking a fine line because they have been seen as a success story in fighting terrorism,” Ann Wainscott, an expert on Morocco’s war on terror and an assistant professor of political science at St. Louis University in Missouri, said. “They want to demonstrate capacity in apprehending suspects without scaring away potential tourists, who may interpret arrests as indicating a broader presence of jihadists than actually exists."

Morocco still remains a far cry from war-torn Libya, where ISIS controls the coastal city of Sirte and has seized key oil ports on the Mediterranean coast. But terrorism experts said the country is becoming more and more vulnerable as the Islamic State group looks to expand its influence on Europe’s doorstep.

“Clearly, the power is shifting from the Persian gulf region to areas in Africa, some of which really aren’t that far from Morocco,” Abrahms said. “Morocco is very well-placed for ISIS.”