ZAKHO, Iraq — The afternoon before his family fled the onslaught of Sunni militants, Dakhil Habash was visited by three of his Arab neighbors. Over tea, his trusted friend Matlul Mare told him not to worry about the advancing fighters and that no harm would come to him or his Yazidi people.

The men had helped one another over the years: Mr. Mare brought supplies to Mr. Habash’s community in the years after the American invasion, when travel outside their northern enclave was too dangerous for Yazidis. Mr. Mare bought tomatoes and watermelon from Mr. Habash’s farm and sometimes borrowed money.

But his friend’s assurances did not sit right with Mr. Habash. That night, he gathered his family and fled. Soon afterward, he said, he found out that Mr. Mare had joined the militants and was helping them hunt down Yazidi families.

“Our Arab neighbors turned on all of us,” said Mr. Habash, who recounted his story from a makeshift refugee camp on the banks of a fetid stream near the city of Zakho, in Iraqi Kurdistan. “We feel betrayed. They were our friends.”