The four boys are aged 15 and 16 and are ethnic Danes, police said.
According to police, the boys threw a burning bottle filled with petrol at the Afghan boy, who suffered serious burns and is in serious condition.
The incident occurred in the small town of Ry, south of Skanderborg, at around 7pm on Monday.
The four suspects made a preliminary court appearance in Horsens on Tuesday morning but the proceedings were held behind closed doors.
Police cautioned that the attack did not initially appear to be a hate crime based on the Afghan boy’s nationality.
“Based on the currently available information, we are probably looking at a conflict between the five boys, who all live and attend school in Ry. There is no current evidence to suggest that the conflict has anything to do with the boys’ different ethnicities,” a police press release said.