GUA MUSANG, Malaysia — Norazila and Ayu were best friends and they shared everything that girls do: sleepovers, selfies, musings about cute boys.

But their friendship, which had blossomed in their placid hamlet in northern Malaysia, was destroyed late last month when Norazila, 14, discovered that Ayu, 11, had secretly become her father’s third wife.

“My best friend is my stepmother now,” said Norazila, whose family name is Che Abdul Karim, as she scrolled through her Facebook page filled with posts of the girls posing with adolescent pouts and fingers forming peace signs. “It doesn’t make any sense.”

Ayu’s marriage to Che Abdul Karim Che Abdul Hamid, a 41-year-old rubber trader with a prominent role at his mosque and a fleet of fancy cars, has reignited debate in Malaysia about the persistence of conservative Islamic traditions in this modern, multiethnic democracy.