The victim, who is under 15, was filmed during the attack, which happened in woodland in Uppsala, south east Sweden.

He was beaten and dragged out to the forest at knife-point before being subjected to an ordeal lasting more than an hour, prosecutors say.

After a trial, the teenagers were found guilty of aggravated rape – but despite requests by prosecutors, they will not be expelled from Sweden because of their age and the dangers they would face in their homeland.

The court said that the boys would have been ‘hit very hard’ by deportation because of the security situation in Afghanistan.

Four of the defendants received jail terms of 15 months while the fifth was given 13 months, Expressen reports.

Prosecutors had claimed that one of the attackers filmed parts of the assault, overnight on October 24 and 25, and posted the footage on social media.

The victim, also from Afghanistan, went to police before five suspects were detained on child rape charges, it has been reported in Sweden.