A Danish school has come under fire for separating students into different classes by ethnicity in a bid to prevent ethnic Danes being outnumbered.

The Langkaer upper secondary school outside the city of Aarhus said its first-year students had been divided into seven different classes, out of which three classes had a 50 percent limit on the number of ethnic minority students.

The remaining four classes consisted only of students from an immigrant background.

Scroll down for video

The Langkaer upper secondary school outside the city of Aarhus said its first-year students had been divided into seven different classes

The school had seen the number of students who are migrants or the children of migrants rise from 25 per cent in 2007 to 80 per cent of this year's first-year students.

The school's headmaster, Yago Bundgaard, denied allegations that the practice amounted to discrimination and said that the aim was to encourage integration by preventing a dwindling number of ethnic Danes from leaving the school.

'For real integration to take place in a class there has to be sufficient numbers from both groups for it to happen,' he told public broadcaster DR.

Describing it as 'the least bad solution', Bundgaard said that the ethnic minority students had been picked based on whether they had 'a Danish-sounding name', but admitted that it was a 'fluid' distinction.

The school had seen the number of students who are migrants or the children of migrants rise from 25 per cent in 2007 to 80 per cent of this year's first-year students. Pictured, migrants in Denmark last year

Turkish-born commentator and former lawmaker Ozlem Cekic said she would report the school to Denmark's Board of Equal Treatment.

'When a headmaster isolates the brown children from the white in an upper secondary school, he is part of sending a signal that the whites must be protected from the brown,' she wrote on Facebook.

Human rights lawyer Nanna Krusaa also told broadcaster TV 2 that 'placing students solely based on race or ethnicity is in my clear view illegal'.

The school's headmaster, Yago Bundgaard, denied allegations that the practice amounted to discrimination. Pictured, migrants near the German border in September last year

Danish Education Minister Ellen Trane Norby said that she had requested a report from the school to ensure that the law was being upheld, but that she was also looking at introducing legislation to make upper secondary schools in Denmark more ethnically mixed.

'The fundamental problem is that we in Denmark have... schools with a too high ratio of students with a different ethnic background than Danish,' she wrote on Facebook.