YAKAWLANG, Afghanistan — The girls began appearing about seven in the morning. Seen from a distance, they made up thin blue lines snaking across the barren tan mountainside along narrow trails traced in the dirt, converging from several directions on the little school in the bottom of the valley.

Wearing powder blue school uniforms and white head scarves, many of the girls, ages 7 to 18, had already been walking for an hour or more by the time they arrived at the school. There were smaller groups of boys, too, mostly out of uniform, walking apart from the girls.

By 7:45, they were all gathered for assembly in the yard of the Rustam School, in a remote corner of Afghanistan’s Yakawlang District. It is the area’s only high school, years 1 through 12, and has an enrollment of 330 girls and 146 boys — astonishing in a country where normally only a third of girls attend school.