A child had found the bomb and brought it to Al-Fatah school in the Hamdan district of Sanaa on Wednesday to show friends, UNICEF said in a statement.
US House rebukes Trump, backs measure to end Yemen involvement
The casualties were aged between 12 and 14.
Children often fall victim to unexploded ordnance, failing to fully appreciate the dangers.
"It is highly likely, as we've seen in Syria, Iraq and elsewhere, that children will continue to be killed even when there's a lull in violence or the violence comes to an end," said UNICEF's regional chief of communications, Juliette Touma.
The World Health Organisation estimates nearly 10,000 Yemenis have been killed since 2015, when Saudi Arabia and its allies intervened to prevent the defeat of the government in the face of a militant offensive.
UN council backs new chief of Yemen mission
Human rights groups say the real death toll is several times higher.
The conflict has pushed millions of Yemenis to the brink of mass starvation, in what the UN has called the world's worst humanitarian crisis.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ