"I had never wanted to kill people here: I went to another country to help those being killed and bombed by Assad, a cruel man. Of course if they put me in prison here when I came back, treated me like an enemy, maybe I would have done something in retaliation," Mehdi reflected, "If that is what is happening in Britain, then they are creating enemies, they must see that."

The reason that Mehdi, a 25-year-old builder, could speak sitting in a café in Copenhagen is that Denmark has decided on a policy of not penalising citizens who have returned from jihad abroad. In Britain they face terrorism charges.

Mehdi, slightly built and quietly spoken with a close-cropped beard, wanted to stress that concern about Western Muslims bringing the jihad home was exaggerated. "Most of the foreigners I met went there to take part in the struggle, like me, against Assad: then some of them got into groups who started fighting between themselves," he said. "Sure, some of them made videos about attacks in Europe and America, but a lot of that was just boasting. But even those who did not do this had their homes in England raided, I know of English guys who are against Islamic State (Isis), but they get questioned when they go back, and that, of course, made them angry."

One of the architects of the Danish rehabilitation scheme, Professor Preben Bertelsen, has had invitations to speak in London on the issue, and similar trips to Norway, Belgium and Germany are planned. But while the Danish government has expanded the programme that started in the city of Aarhus across the country, these states follow the same policy as the UK of taking punitive action against returnees.

In recent days, two brothers from east London, Mohommod and Hamza Nawaz, 30 and 24, became the first UK nationals to be jailed for receiving military training in Syria.

Mehdi, who is of North African descent, travelled to Syria last year to join in the fight against the Damascus regime; but he left after nine months, disillusioned by the bloody infighting between the rebels.

He was guarded about his activities. He had been, he said, with two "katibas" or battalions, neither of them fanatical in the directory of the Syrian jihad. He also admitted to carrying a gun, but claimed that his main task was to repair warehouses where supplies were stored.

"But then you had different groups stealing supplies from each other, even food", he said. "I was very disappointed with that and also Muslim groups fighting each other."

Mehdi had spent some time in Aleppo at the same time I was in Syria. The districts he mentioned were then in the hands of Jabhat al-Nusra, affiliated to al-Qaeda. Mehdi insisted that he had not fought for the militants, although he "knew" many of its members and pointed out that the group had fought against Isis. "But now the Americans are bombing both Nusra and Isis, this will surely bring them together," he said.

Under Danish law, anyone returning from Syria will be screened by the police to ascertain whether he or she committed a crime, although there seems to be confusion among officials on what would constitute the relevant criminal act.

What is more definite is that more people went from the country to Syria per head of population than any other part of Europe apart from Belgium. Around 30 per cent of these Muslim volunteers came from Aarhus, Denmark's second city but with a population of no more than 325,000. A finger of blame has been pointed at a mosque in the district of Grimhojvej, which has been accused of espousing fundamentalism and failing to condemn IS and other extremist groups.

There were calls for the mosque to be shut down, but the authorities in Aarhus chose instead to engage in intensive dialogue.

"Since this started in January the travel to Syria from Aarhus has stopped," said Professor Bertelsen. "The mosque leaders accepted that they have a responsibility. For those in the programme, we are not asking them to stop practising their religion or alter their religious and political views – after all we are living in a democracy. What we are asking is that they do not do so in a violent way: that is the requirement."

In a poll last year, Denmark was voted the "happiest place in the world" to live. After the flaring-up of acrimony over the cartoons of Prophet Mohamed, communal tensions appear to have subsided.

But not all among its population appreciates this. In a video posted from Syria, a Danish jihadist, Abu Khattab, proclaimed: "We are given everything in Denmark … But the infidels could not deceive us, jihad is the greatest reward: your blood will smell sweet: your imam will appear before you as a luminous bubble."

Some Danish politicians say that the relationship between the host population and parts of the Muslim community is now beyond repair. "The whole Aarhus project was misconceived, it was rewarding these people. What we are seeing is a clash of civilisations," said Marie Krarup, an MP from the Danish Peoples' Party, the third largest in the country. "Islam is violence; moderate Muslims are not a problem, but even they can become extreme over time. It is OK to beat your wife, to kill those who are not Muslims. You simply cannot integrate a great number of them into a Christian country."

Professor Bertelsen said: "We are not surprised by what some politicians say, but we are rather tired of the same things they say. What is the solution? In three years' time, if IS is defeated, we are going to have between 3,000 and 6,000 very angry young men coming back to northern Europe. They may even turn to people more extreme than Isis.

"Danes ask themselves why these people hate them so much when they've given so many opportunities. It's probably the same in places like England. But there is often a history of exclusion, low level racism," he added. "They feel unwanted and they go to Syria to look for existential answers; we aim to help them to see that they do have a future in this society."