The first images from a trial of Emmanuel Macron’s compulsory national service for French teenagers have sparked criticism on the left that youngsters are made to wear uniforms, attend early morning flag ceremonies and repeatedly sing the national anthem.

Macron had caused surprise during his presidential campaign in 2017 when he promised to introduce compulsory national service to give girls and boys “a direct experience” of military life.

The project was then tweaked to become compulsory civic service – with input from the military but without any dealings with weapons – in which youngsters would learn about first aid, self-defence and republican values as way of bringing “social cohesion” to a fractured nation.

This week, the first trials began with teenagers from different backgrounds boarding together for two weeks – in buildings including boarding schools, holiday villages and university campuses – where they would take part in debates about society, learn map reading and first aid, and be taught about gender equality and how to recognise fake news, before a second phase of two weeks volunteering with a charity or local government.

But when the first images emerged of scores of youngsters in immaculate navy blue uniforms, lined up army-style and singing the national anthem at early morning flag ceremonies, critics on the left denounced the exercise as too costly and a type of forced nationalism that should not be made compulsory.

Ministère des Armées (@Defense_gouv) La secrétaire d’État auprès de la ministre des Armées, @gdarrieussecq, avec les 1⃣1⃣8⃣ jeunes volontaires du centre #SNU de Morbecque (Nord). Un moment d'échange privilégié avec ces pionniers et leurs tuteurs 💪#ServiceNationalUniversel pic.twitter.com/QqdSXSbe9c

Images of youths watching the France-Nigeria women’s football World Cup match while standing in a perfect line with a government minister sparked criticism on social media. Concern was also raised as some volunteers briefly fell ill in the heat while lined up watching a ceremony in honour of Gen Charles de Gaulle in Normandy.

One high-school union, the UNL, which has opposed the project, said: “Is it in keeping with the times to constrain young people to go and sing under a flag at 8am in the morning? This universal national service must not be made compulsory.”

Céline Malaisé, a Communist regional councillor, tweeted: “This old nationalist nightmare repulses me.” She likened it to “denying the free will of young people, their engagement, their critical spirit” and called it a hypocritical “masquerade” while not enough resources were being placed in schools.

The Socialist politician Boris Vallaud said the estimated cost of more than €1.5bn (£1.3bn), once the service becomes compulsory in 2026, should instead be pumped into education. He said it was the job of schools to ensure cohesion, arguing that trying to claim that “fraternity” could be learned in two weeks sharing a room was a “fantasy”.

Gabriel Attal, a junior minister for youth and education, defended the service as a way to build cohesion and learn practical skills, from first aid and rescue skills to conservation.

Préfet du Morbihan (@Prefet56) [#SNU] Retour en vidéo sur la 1ère journée des 97 jeunes volontaires du SNU #Morbihan avec, au programme, la cérémonie de levée des couleurs et la Marseillaise, des activités de cohésion en pleine nature 🙌et un module Prévent°/Promot° de la Santé@france3Bretagne @Jeunes_gouv pic.twitter.com/cI9xJBbv6D

He described the routine in Le Parisien newspaper: “Every morning, they will wake at 7am and take part in a flag ceremony at 8am with the national anthem. Each day, there will be different modules, for example learning about defence, sustainable development or the values of the republic. They will have an hour of free time at the end of the day, when they can use their mobile phone. Their phones will be banned for the rest of the time.”

He said it was about helping young people to “learn the reflexes to defend and protect themselves”, such as how to react to a terrorist attack or natural disaster. He said there would be crisis simulations such as nuclear accidents.

France phased out compulsory military service between 1996 and 2001. Macron, 41, is the first French president not to have been called up to serve in the army.

When he first announced the idea of introducing compulsory national service, Macron framed it as part of France’s efforts to prepare for an era of global “turbulence” comparable to the cold war.

But the campaign promise was also seen as a way of playing up patriotic nostalgia for military service at a time of increasing social divisions.