Khadiza, with straight chocolate-colored hair and thick-rimmed glasses, had been singled out as one of the most promising students of her academic year, according to a letter her mother received after mock exams only weeks before she left. In her bedroom, she kept a copy of a novel that a teacher had given to her with a handwritten dedication inside, dated January 2015: “Well done for working hard and exceeding your target grade for English language.” In her spare time she tutored less-gifted peers.

Her bubbly friend Amira was a star athlete and a respected public speaker, once debating the rights of Muslim women to wear veils. She was a regular at the local library, where she read voraciously. (After her disappearance, when the police went to check the list of books she had borrowed, one title, “Insurgent,” briefly rang alarm bells — until the officer realized that it was part of a popular dystopian teenage trilogy set in Chicago.)

“They were the girls you wanted to be like,” said one 14-year-old from the grade below theirs.

Perhaps that is why everyone failed to respond to the many signs that foreshadowed their dark turn. The families, who noticed the girls’ behavior changing, attributed it to teenage whims; school staff members, who saw their homework deteriorate, failed to inform the parents or intervene; the police, who spoke to the girls twice about their friend who had traveled to Syria, also never notified the parents.

They were smart, popular girls from a world in which teenage rebellion is expressed through a radical religiosity that questions everything around them. In this world, the counterculture is conservative. Islam is punk rock. The head scarf is liberating. Beards are sexy.

Ask young Muslim women in their neighborhood what kind of guys are popular at school these days and they start raving about “the brothers who pray.”

“Girls used to want someone who is good-looking; nowadays, girls want Muslims who are practicing,” said Zahra Qadir, 22, who does deradicalization work for the Active Change Foundation, her father’s charity in East London. “It’s a new thing over the last couple of years. A lot of girls want that, even some nonpracticing girls.”

The rows of housing complexes behind Bethnal Green’s main street are home to a deeply conservative Muslim community where the lines between religion and extremism can be blurred, including in at least one of the girls’ families. In this community, the everyday challenges that girls face look very different from those of their male counterparts.