Kampala: At least 40 people, mostly students, were killed and eight others critically injured after terrorists linked to the Islamic State terror group attacked a school in Uganda located near the border with the Democratic Republic of the Congo (DRC), police said on Saturday.

The attack took place at around 11.30 p.m. on Friday night at the Lhubiriha secondary school in Mpondwe, during which a dormitory was burnt and a food store was looted, reports the BBC.

In a statement, the police said the attack was carried out by the Allied Democratic Forces (ADF) -- a DRC-based Ugandan rebel group which is a branch of the IS in Central Africa.

Police spokesperson Fred Enang said the Uganda People's Defence Forces and the police are currently carrying out a search operation for the group who fled towards Virunga National park in the DRC after the attack.

The army has also deployed planes to help track the rebel group.

Enang said many of the bodies were transferred to the Bwera Hospital, where the critically injured persons are also undergoing treatment.

"We do offer our deepest condolences to the families of those who have been killed, and offer our prayers and thoughts to those who have been wounded," he said, noting that more details will be availed in due course.

Meanwhile, Major General Dick Olum from the Ugandan army told the media that some of the male students were burnt or hacked to death, the BBC reported.

Others at the school, mostly girls, have been abducted by the group, he added.

Some of the bodies are said to have been badly burnt and DNA tests will need to be carried out to identify them.

The latest incident comes a week after suspected ADF fighters attacked a village in the DRC near the Ugandan border.