MOGADISHU (Reuters) - Somali authorities said troops stormed a school run by al Shabaab on Thursday night and rescued 32 children who had been taken as recruits by the Islamist militant group.

“The 32 children are safe and the government is looking after them. It is unfortunate that terrorists are recruiting children to their twisted ideology,” Abdirahman Omar Osman, information minister for the Somali federal government, told Reuters on Friday.

“It showed how desperate the terrorists are, as they are losing the war and people are rejecting terror.”

Al Shabaab said government forces, accompanied by drones, had attacked the school in Middle Shabelle region. It said four children and a teacher were killed.

The Somali government said no children were killed in the rescue.

“They kidnapped the rest of the students,” said Abdiasis Abu Musab, al Shabaab’s military spokesman.

“Human Rights Watch is responsible for the deaths of the students and their teacher because it pointed fingers at them,” he added.

In a report this week, the New York-based rights group said that since September 2017, al Shabaab had ordered village elders, teachers in Islamic religious schools, and rural communities to hand over hundreds of children as young as eight.

The U.S. Africa Command said it had carried out an air strike on Thursday against al Shabaab targets 50 km (30 miles) northwest of Somalia’s port city of Kismayo, killing four militants. U.S. forces regularly launch such aerial assaults.

The al Shabaab militia, linked to al Qaeda, is fighting to topple the U.N.-backed Somali government and establish its own rule based on a strict interpretation of Islam’s sharia law.

Somalia has been plagued by conflict since the early 1990s, when clan-based warlords overthrew authoritarian ruler Mohamed Siad Barre then turned on each other.

In recent years, regional administrations headed by the Mogadishu-based federal government have emerged, and African Union peacekeepers supporting Somali troops have gradually clawed back territory from the Islamist insurgents.