By Mushtaq Yusufzai, Wajahat S. Khan and F. Brinley Bruton, NBC News

PESHAWAR, Pakistan (NBC News) Uniformed militants attacked a school, killing at least 126 people and taking hostages on Tuesday, according to an official.

"The gunmen entered class by class and shot some kids one by one," a student who was in the school at the time told local media.

Provincial official Bahramand Khan said at least 126 people were killed and 122 injured. More than 100 of the dead were school children, he added. The Pakistani Taliban claimed responsibility for the assault.

Commandos were sent to the scene and exchanged fire with gunmen who entered the Army Public School in Peshawar. Five "heavy" explosions were heard from the school at around 5 a.m. ET. The Pakistani military later said four Taliban militants had been killed.

About 500 students and teachers were believed to be inside the site when gunfire erupted, although it was unclear how many remained inside the school.

A military source who spoke on the condition of anonymity told NBC News that there were at least 10 attackers wearing police uniforms and suicide vests. "They burnt a teacher in front of the students in a classroom," he added. "They literally set the teacher on fire with gasoline and made the kids watch."

Some child hostages were thought to be held at gunpoint by militants in the school's main auditorium. The military-run school has students in grades one through 10.

Wounded student Abdullah Jamal told The Associated Press he was getting first-aid instructions and training with a team of Pakistani army medics when the violence began for real. When the shooting started, Jamal said nobody knew what was going on in the first few seconds. "Then I saw children falling down who were crying and screaming. I also fell down. I learned later that I have got a bullet," he said, speaking from his hospital bed. He had been shot in the leg.

"We were standing outside the school and firing suddenly started and there was chaos everywhere and the screams of children and teachers," said Jamshed Khan, a school bus driver.

A security official who spoke on the condition of anonymity said two helicopter gunships had also been sent to the site, but could not fire because students and teachers were still inside the school building.

Television images showed anxious parents gathering on the street near the school, as gunfire and explosions were heard nearby.

Malala Yousafzai, campaigner for girls and joint winner of the 2014 Nobel Peace Prize, said the attack was "atrocious and cowardly," adding that she was "heartbroken by this senseless and cold blooded act of terror." In a statement, she said: "I, along with millions of others around the world, mourn these children, my brothers and sisters - but we will never be defeated."

Kailash Satyarthi, the Indian children's rights advocate who shared the Nobel prize with her, wrote on Twitter: "These are all our children who've been murdered today. My heart bleeds for bereaved families. One of the darkest days of humanity."

The U.S. stands "in solidarity" with the people of Pakistan and "strongly condemns senseless and inhumane attacks on innocent students and educators," Ambassador Richard Olson said in a statement. "Few have suffered more at the hands of terrorists and extremists than the people of Pakistan. That is why it remains essential for the United States and Pakistan to continue to work together to secure peace and stability in the region."

The Pakistani Taliban has vowed to attack government targets as it fights off a huge army operation in the country's tribal region.

Taliban spokesman Muhammad Umar Khorasani told Reuters his group was responsible for the attack. "Our suicide bombers have entered the school, they have instructions not to harm the children, but to target the army personnel," he said.