The bombing of a school in Somalia’s southern region of Shabelle has left at least eight people dead and 13 wounded, according to local officials.
The attack happened on Monday morning in Garowe, the capital of the semi-autonomous Puntland region.
Bomb disposal teams defused a second device at the scene.
Bombings have increased in Somalia in recent years, as violence intensifies in the rest of the country.
Puntland has experienced a flare-up of fighting between rival militias.
In December, a double suicide bomb attack at a court complex in the southern port city of Kismayo killed at least 18 people.
Garowe, which is about 300km (180 miles) from the capital Mogadishu, is a popular destination for Somalis seeking education, since it is both landlocked and part of the internationally-backed federal government.
Residents say the blast occurred near the mosque where Muslims were chanting prayer, and many of the wounded have received treatment in the city’s hospitals.
Ibrahim Salah, governor of Puntland’s Aden Abdulle district, confirmed the attack had taken place, but added the death toll was “too high”.
Monday’s attack was claimed by Islamist group al-Shabab, which said it had targeted a prison in the area.
BBC’s Mohamed Abdi-Guled in Somalia says Somalis are concerned that the Al-Shabab, a group which opposes the current government, could stage attacks in Mogadishu as well.
Puntland, which has its own government and army, is a largely peaceful region, with a history of combat with the more extreme Al-Shabab.
But Puntland has also faced ethnic violence and Islamist-led rebels from neighbouring regions.
In October, insurgents from the Al-Shebab killed at least 10 people with an attack on the town of Hudur.
Al-Shabab is also affiliated with Al-Qaeda. It has been linked to other violence, including the 1998 embassy bombings in Kenya and Tanzania.
A Somali transitional government has been in place since 2011. The new prime minister Ahmed Mohamed Ali is scheduled to be sworn in on Tuesday.
On Friday, the Horn of Africa nation suffered its worst-ever attack, when at least 500 people were killed when gunmen opened fire on a beach and set off a truck bomb in the capital Mogadishu.