IBRAHIM ZAHAR, Tunisia — The same day that Jabeur Khachnaoui was gunning down foreign tourists at the National Bardo Museum in Tunis last month, one of his older brothers was on the other side of town, attending a rally against terrorism.

The two brothers grew up in a family with three other siblings in this small hamlet of olive groves in Tunisia’s impoverished southwest. They were close but, in just a few years, had ended up deeply divided in their outlooks, much like their country itself.

The older brother went to study philosophy in Tunis, while the youngest brother stayed at home and became intensely religious. After the older brother read about the attack online late that night, it was friends who broke the news to him that Jabeur Khachnaoui was one of the perpetrators.

“I felt very confused,” he said in an interview in his home village. Still wrestling with the shame attached to his brother’s actions, he asked that his first name not be published. “I never thought he would do this. Terrorism is a strong hypnotizer, and it happened in the blink of an eye.”