French primary school children are to be taught to sing the national anthem in public and to recite the “meaning of the construction of Europe” to boost patriotism and ward off the type of Euroscepticism that led to Brexit.

It is also hoped the changes to the French curriculum will prevent children born into families who immigrated from former African colonies from falling foul of Islamist preachers when they hit their teens.

Jean-Michel Blanquer, the education minister, wants pupils to learn La Marseillaise, as well as the origins of France’s blue, white and red flag and the meaning of liberty, equality and fraternity.

To ensure children are not lured into finding favour with “Frexit”, they will also learn the meaning of the European flag and to be able to recognise Beethoven’s Ode to Joy, the anthem of the EU, which French president Emmanuel Macron had played on his electoral victory night.

The curriculum, to be rolled out in primary schools this autumn, aims to help train model French citizens. In a report, the education ministry’s higher council said the changes would bolster democratic principles, gender equality and human rights.