Militants who saw one student, Hafsat Lawan, 17, and her friends hurrying over the fence beckoned them to come for safety. The girls started toward the fighters but, Ms. Lawan later said, became suspicious of their turbans and sandals and their use of the local language, which is often unfamiliar to soldiers recruited from across the country. She fled.

“The sad thing is some of the students ran to them — including my younger sister,” said Ms. Lawan, whose 14-year-old sister is presumed to be among the hostages.

Fatima Bukar, 14, was in her dorm near to the school fence when she heard gunshots. “We weren’t sure where it was coming from,” she said. “We were confused.”

One girl ran toward Fatima and her friends, telling them to flee for their lives because Boko Haram had arrived. Fatima said she saw girls being led outside the school gate and into militants’ trucks; she recognized many friends among them.

“They were saying if you run we will shoot you,” she said. “They were shooting into the air.”

Fatima bolted over the fence and ran through the bush, thinking that because the area had no road, the militants would be less likely to chase her. She fled with about 30 girls and a teacher who led them to a farm, where the group spent the night, too terrified to fall asleep.

At his home not far from the school, Fatima’s father, Auwal Bukar, was panicking. He had crouched in his house when he heard gunshots. He peeked outside later and saw trucks packed with girls. It was dark, but their sobs were unmistakable.

“We could hear them crying very clearly,” he said.

As the trucks headed outside town, witnesses said, some of the girls appeared to be tied up with their own clothing. They heard the screams as the vehicles sped away.