The suicide blast went off near the entrance to a police and army post, said Yacoub Khan, the deputy police chief of the eastern province of Khost. U.S. troops are also stationed inside the outpost, but no troops were wounded or killed in the attack.
The U.S. military said that 16 people were killed, including 14 students, an Afghan soldier and another person, who was likely an Afghan security guard that Afghan officials said was killed.
Dr. Abdul Rahman, a doctor at a hospital near the blast, said the children were aged 8 to 10.
Photos of the bombing's aftermath showed bloodied text books lying on the ground beside small pairs of shoes. The U.S. military also released images of the blast caught on a security camera.
U.S. Gen. David McKiernan, the top NATO commander in Afghanistan, said he believes the militant network run by warlord Siraj Haqqani was responsible for the attack.
"The brutality and disregard for human life by terrorists is sickening, as I continue to witness innocent men, women and children being killed and maimed in the pursuit of this pointless insurgency," McKiernan said in a statement.
Abdullah Fahim, spokesman for the Ministry of Health in Kabul, said eight people in total died and 51 were wounded. Khan, reached late Sunday night, said he believed that only five school children had died. It wasn't possible to reconcile the differing death tolls.
Khan said the attack came at a time when Pashtun tribal elders from Mandozai district were meeting inside the compound to discuss security issues. It was not immediately clear how many - if any - of those tribal leaders were wounded or killed.
The attack came on the last day of school for the year. Students had gathered in the classrooms to receive end-of-year certificates, Nang said.
Afghan President Hamid Karzai condemned the attack and called it "un-Islamic."
"Those who ordered and executed this attack cannot escape the revenge of Afghans and God's punishment," Karzai said in a statement.
A U.N. spokesman said the U.N. mission in Afghanistan was "appalled" at the suicide attack.
"The deaths of young children who were receiving their end-of-year education certificates are particularly galling," said Dan McNorton.
The blast in Khost province came only hours after a late-night rocket attack in Kabul on Saturday killed three teenage sisters. McNorton said that attack "also reminds us of the true impact this conflict has on those who play no part in it."
Violence has spiked across Afghanistan the last two years, and the U.S. plans to send between 20,000 and 30,000 additional troops to Afghanistan over the next six months to reinforce the 32,000 U.S. forces already in the country.
More than 6,100 people have died in insurgency-related violence this year, according to an Associated Press count of figures from Western and Afghan officials.
The year has also been the deadliest for NATO soldiers since the 2001 invasion to oust the Taliban.
In the south, a roadside bomb killed two Canadian soldiers and two Afghans working alongside them in a dangerous region of southern Afghanistan, Canada's military said Sunday.
In addition to those killed in Saturday's roadside bomb attack, four Canadian soldiers and one Afghan interpreter were wounded, the military said.
The two Afghans killed in the blast in the Panjwayi district of Kandahar province included an interpreter and a police officer.
NATO officials have said that Canadian troops have suffered more deaths per capita than any other foreign military in the country. More than 100 Canadians have been killed.
Elsewhere, coalition forces killed five militants and detained six during operations in Kabul and Paktika provinces on Saturday, the U.S.-led coalition said Sunday.