The Danish education system has its origin in the cathedral- and monastery schools established by the Roman Catholic Church in the early Middle Ages, and seven of the schools established in the 12th and 13th centuries still exist today. After the Reformation, which was officially implemented in 1536, the schools were taken over by the Crown. Their main purpose was to prepare the students for theological studies by teaching them to read, write and speak Latin and Greek.
Popular elementary education was at that time still very primitive, but in 1721, 240 rytterskoler ("cavalry schools") were established throughout the kingdom. Moreover, the religious movement of Pietism, spreading in the 18th century, required some level of literacy, thereby promoting the need for public education. The philanthropic thoughts of such people as Rousseau also helped spur developments in education open to all children.
In 1809, the old Clergyman's School was transformed in accordance with the spirit of the time into a humanistic Civil Servant's School which was to "foster true humanity" through immersion in the ancient Greek and Latin cultures combined with some teaching of natural science and modern languages.
Throughout the 19th century (and even up until today), the Danish education system was especially influenced by the ideas of clergyman, politician and poet N. F. S. Grundtvig, who advocated inspiring methods of teaching and the foundation of folk high schools.
In 1871, the scientific and technical development of the 19th century led to a division of the secondary education into two lines: the languages and the mathematics-science line. This division was the backbone of the structure of the Gymnasium (i.e. academic general upper secondary education programme) until the year 2005.
In 1894, the Folkeskole ("public school", the government-funded primary education system) was formally established (until then, it had been known as Almueskolen ("common school")), and measures were taken to improve the education system to meet the requirements of industrial society.
In 1903, the 3-year course of the Gymnasium was directly connected the municipal school through the establishment of the mellemskole ('middle school', grades 6-9), which was later on replaced by the realskole. Previously, students wanting to go to the Gymnasium (and thereby obtain qualification for admission to university) had to take private tuition or similar means as the municipal schools were insufficient.
In 1975, the realskole was abandoned and the Folkeskole (primary education) transformed into an egalitarian system where pupils go to the same schools regardless of their academic merits.
Recently, some political parties (e.g. Social Democrats and Liberal Alliance) have advocated extending the time of compulsory education from nine to twelve years.