SORKHROAD, Afghanistan — At least three times a week, Malaika hikes up the mountain, past mulberry and pine trees, to a clearing where she can get cellphone reception. She calls her family to reassure them that the Islamic State fighters have not come for her yet.

Below, her village — Bagh, in the Maamand Valley in eastern Afghanistan — has been gutted by the Islamic State militants who overran it three months ago. Most of the houses have been looted, burned or simply taken over by the fighters, and the 80 or so families that lived there have been forced to seek refuge near Jalalabad city.

Malaika, vigorous in her late 50s, is one of three women who decided to stay behind to try to keep their homes.

“The poor woman is guarding the windows and the planks of the two rooms that remain,” her husband, Mullah Jan, said last month. Mr. Jan was held by the militants for two months until he paid them $500 ransom. “We had 10 goats and one cow. They took all of it.”