FONTANA, Calif. — In the days after the December terrorist attack in San Bernardino, Calif., when pictures of the hijab-wearing suspect filled television screens and newspapers, Zarifeh Shalabi’s mother and aunts stayed at home.

With their home just a few miles from the scene of the attack that left 14 dead, they worried about an anti-Muslim backlash. When they went shopping, Zarifeh, 17, said, other mothers pulled their children away when they saw the women wearing head scarves.

“We were more afraid that someone was going to hurt us,” Zarifeh said.

But this month, Zarifeh received the ultimate symbol of teenage acceptance: She was crowned prom queen after her non-Muslim friends campaigned for her by wearing hijabs in solidarity.

“We saw it as a chance to do something good, to represent something good,” said a friend, Sarahi Sanchez, who like Zarifeh is one of a few dozen peer mentors at Summit High School. “This was a way to prove we don’t have problems with bullying or racism.”