The middle-class Islamists behind Tunisia's museum attack

One of the young men was a high school literature student who helped his father tend the family olive trees in their isolated farming community near the Algerian border.

The other lived in the capital Tunis, had a taste for fashion and worked as a travel agent.

Jabeur Khachnaoui and Yassine el-Abidi came from stable, middle-class families and were well educated.

On March 18, they came together to attack Tunisia's Bardo Museum, shooting foreign tourists as they filed off buses outside the museum, and then taking more tourists hostage inside.

Over three hours they killed 22 people in all, including French, Italian, Japanese, Russian and Spanish visitors. Security forces eventually stormed the building and shot and killed the hostage-takers.

To their families, the two young men seemed to lead normal lives. But according to Tunisia's interior ministry, they both spent time in militant camps in Libya late last year before returning to Tunisia, their ideologies fine-tuned and basic military training completed.

Their stories show how difficult it will be for Tunisia to stop others making similar journeys. The country and region are full of young men like Khachnaoui and Abidi, and Islamist groups are increasingly targeting middle-class recruits.

The Bardo massacre has also reopened debate on the country's delicate balance between the need for security, and the rare freedoms enjoyed by both secular Tunisians and conservative Islamists.

Tunisia is one of the Arab world's most secular nations and has won praise for its democratic progress since the 2011 Arab Spring uprising, which began there. It has mostly escaped the violence and upheaval afflicting Libya and Egypt. And it has a new constitution, free elections and a political balance that have helped keep the country stable.