They were in classes or taking tests. Wearing their green blazers and white shirts, some of the students sat listening to a lecture.
Then, the Taliban gunmen came, bursting through doors and firing in all directions.
The horror that followed Tuesday at the Army Public School and Degree College in Peshawar, Pakistan, has shocked the world: 145 people dead, most of them children.
Here are accounts by students, teachers and parents of what they witnessed during those hellish hours.
THE STUDENTS
School tie as a tourniquet
Mohammed Bilal, 13, said he was taking a math test when the gunfire started.
“My thigh was burning like metal — I fell,” the seventh-grader told CNN at Peshawar’s Lady Reading Hospital where he was being treated for his injuries.
But using his school tie as a tourniquet, Mohammed managed to run to the gate and escape the mayhem.
‘A lot of children are under the benches — kill them.’
Another student in the hospital, 14-year-old Ahmed Faraz, said he was in the school’s auditorium when four or five people burst in through a back door and “started firing rapidly.”
The ninth-grader told CNN that after a bullet hit his left shoulder, he lay under one of the benches in the room.
The militants were shouting, “God is great,” as they stalked through the auditorium, according to Ahmed.
Then, he said, one of them observed that “a lot of the children are under the benches,” before uttering a chilling order: “Kill them.”
“My shoulder was peeking out of the bench, and somebody was following,” Ahmed recalled. “They went into another room, (and when) I ran to the exit, I fell.”
‘I saw death so close’
Shahrukh Khan, 16, was also in the auditorium when the gunmen charged in. He gave Agence France-Presse a similar account to the one given by Ahmed. But he also described in harrowing detail his brush with death.
“I saw a pair of big black boots coming towards me, this guy was probably hunting for students hiding beneath the benches,” he told the French news agency. Khan said he felt burning pain in both his legs as he was shot just below the knees.
He said he played dead, cramming his tie into his mouth so that he wouldn’t scream.
“The man with big boots kept on looking for students and pumping bullets into their bodies,” he told AFP. “I lay as still as I could and closed my eyes, waiting to get shot again.”
“My body was shivering. I saw death so close and I will never forget the black boots approaching me — I felt as though it was death that was approaching me.”
After the men left, Khan said he tried to get up but fell to the ground because of his injuries.
“When I crawled to the next room, it was horrible. I saw the dead body of our office assistant on fire,” he said. “She was sitting on the chair with blood dripping from her body as she burned.”
He said he took refuge behind a door and then passed out, waking to find himself on a hospital bed.
THE TEACHERS
‘I couldn’t move’
Zulfiqar Ahmad, a teacher, told the BBC he was holding a math class in the school’s central wing when he heard gunshots.
“There was panic in the classroom and some students rushed out to see what was going on, but they soon came rushing back in,” he said. “One of them closed the door and put on the latch.”
But the militants broke down the door and started shooting wildly.
“I was hit in the left arm, in the left side of my chest, and twice on my left thigh,” Ahmad told the BBC. “I fell to the ground. I must have been lying there for an hour before the army soldiers came in and moved me to the hospital. I tried to turn on my right side to prevent bleeding from my arm, but I couldn’t move.”
He said that there were 18 students in the class and that he believes that none of them survived.
Gunmen hit rooms ‘one by one’
Mudassar Abbass, a physics lab assistant at the school, described the gunmen’s ruthless approach.
“The men entered into the rooms one by one and started indiscriminately firing at the staff member and students,” he told AFP.
The exams and the lecture in the auditorium meant students were grouped in different parts of the school, he said.
THE PARENTS
‘A second life’
Some parents who rushed to the school or the hospitals where the wounded were being treated had their worst fears allayed.
Muhammad Arshad gave a sigh of relief after soldiers rescued his son Ehsan, The New York Times reported.
“I am thankful to God for giving him a second life,” he said.
‘In uniform in the morning .. in a casket now’
But many others were confronted with devastating news.
“My son was in uniform in the morning. He is in a casket now,” cried Tahir Ali as he came to the hospital to collect the body of his 14-year-old son, Abdullah.
“My son was my dream,” Ali told The Associated Press. “My dream has been killed.”
‘Why did you snatch away my son?’
Irshadah Bibi, 40, whose 12-year-old son was among the dead, beat her face in grief, AFP reported.
“O God, why did you snatch away my son?” she sobbed. “What is the sin of my child and all these children?”
She was throwing herself against an ambulance at the Lady Reading Hospital, AFP said, one of many inconsolable parents.