Extremists target Tunisia's tourists and the tourism industry to increase unemployment, making young people vulnerable to radicalization. Above, armed guards patrol Marhaba beach in Sousse June 29, 2015. Jeff J. Mitchell/Getty Images

When Islamic State group extremists told Malik they would send his family $1,500 through a Western Union wire transfer the day he arrived in Syria to fight, he packed his bags that night. Malik, whose real name is being withheld for security reasons, had quit school in Tunisia at 14 and gotten a low-paying job at a hotel gift shop to support his family. He was lucky: Nearly 40 percent of Tunisia’s youth is unemployed. But the income wasn’t enough, and the economy was getting worse, so, at 17 years old, he took the alternative option offered by the militants.

“People become discouraged with life. Young people are, mentally, very weak, and they become brainwashed,” says Wael Ouni, Malik’s 18-year-old cousin from Sousse.“You could say it’s like a travel agency that recruits militants.”

A year after Ouni’s cousin was arrested by Tunisian security forces, the country’s economy suffered a devastating blow: The 24-year-old Seifeddine Rezgui walked onto the beach outside the Hotel Riu Imperial Marhaba and opened fire on tourists last Friday. Rezgui was allegedly affiliated with the militant group formerly known as either ISIL or ISIS. It was the deadliest terrorist attack in Tunisia in decades and threatened the country’s already vulnerable economy.

Tunisia’s biggest source of extremism isn’t sectarian tension or open war, it’s a youth-unemployment problem that’s only become worse since the Arab Spring -- and now thousands more are at risk. Ouni himself is now among the unemployed: He lost his job at the Hotel Riu Imperial Marhaba a day after the attack.

Terrorist groups such as al Qaeda and the Islamic State thrive amid poverty, as socioeconomic squalor facilitates their radicalization and recruitment efforts.

A high youth-unemployment rate “helps prepare an environment where it’s easier for that narrative to take root. It makes some of them more receptive,” said J. Peter Pham, director of the Africa Center at the Atlantic Council, an international-affairs think tank based in Washington. “For the person looking for a job or struggling to make ends meet, macroeconomic theory doesn’t put bread on the table.”

Extremist recruiters often prey on those who are new converts to Islam, those with a weak financial standing and a feeling of being wronged by society.

Rezgui was a graduate of the Higher Institute of Applied Science and Technology of Kairouan, no easy feat for a boy from Sousse’s El Zouhour neighborhood, known for its striking poverty and marginalized population. This program doesn’t involve studying religion, so many learn about Islam at their local mosques. According to the country’s interior ministry, most Tunisians who have been radicalized had little or no religious education in schools.

Tunisian Unemployment Rate Over Time | FindTheData

Rezgui’s story is not unique. The highest number of foreign fighters to join the Islamic State group in Iraq and Syria have come from Tunisia, and hundreds have returned home. Most of the fighters who have returned came back with the intention of bringing the fight to Tunisia. Fighting in Iraq and Syria, or simply attempting to do so, results in jail time. Tunisia’s prisons are at 138.9 percent of capacity -- and former fighters are placed in close quarters with other prisoners -- making those prisons fertile recruitment grounds for extremist groups.

Tunisia, considered to be the only political success story of the Arab Spring revolutions that swept the region in 2011, is in economic chaos. And extremist groups take advantage of this fact by attacking the country’s travel-and-tourism industry, which accounted for 13.8 percent of total employment there in 2013, the World Travel and Tourism Council reported.

Tourism is “an industry that reacts quickly and negatively to security concerns, but that takes a long time to recover once the perception of insecurity is set,” according to a report by the Soufan Group, a security-service company headquartered in New York.

In March, gunmen claiming allegiance to the Islamic State group stormed the Bardo National Museum in the Tunisian capital of Tunis, killing 23 people, many of whom were visiting the country while on a cruise. Experts expected the tourism industry, which accounted for 15.2 percent of the country’s gross domestic product, to take a big pounding after the Bardo attack. And the industry hasn’t yet fully recovered from the hit it took during the Arab Spring.

Now, the situation will worsen. After the attack at the hotel Friday, 2,800 tourists were expected to leave Sousse and Port Kantaoui, Tunisia’s main beach town. Airlines and tour companies, such as Thomas Cook, have cancelled trips to the country. Hundreds of hotels have been closed and have no scheduled dates to reopen.

Tunisia’s unemployment woes are not limited to terrorist attacks on tourism. Southern Tunisia is home to phosphate lines owned by Groupe Chimique Tunisien, whose revenue makes up between 4 and 5 percent of the country’s GDP. For months, labor disputes have forced the company to halt operations. Unions are demanding the firm create more jobs for those in its areas of operations, but it is already overstaffed, experts said.

“The strike ... is to draw attention to the bad conditions in the region, the unemployment, despite the phosphate riches there,” union leader Ali Jdidi told Middle East Online. “People want jobs more than anything.”

Ouni used to spend his days boasting of Tunisia’s sparkling ocean waters, white-sand beaches and hospitality workers whose warmth was matched by the summer sun. At 18, he knew he was lucky to have his job. He could help his mother with bills and save for his education.Friday, his future died on that same beach.

“I was lucky to have this job, there are so many unemployed people, and they paid me well,” Ouni said. “We lost. It hurts the heart. All the hotels are empty, everyone is gone.”