Frankfurt: A 20-year-old German man was sentenced to three years and nine months in prison on Friday after he admitted joining Daesh militants in Syria, in the first trial in Germany of a home-grown jihadi accused of membership of the insurgent group.

Judges decided to treat the man, known as Kreshnik B., who was born in Germany to Kosovan parents and spent six months in Syria last year, as a juvenile because of his lack of maturity.

They said there was no evidence he had fought directly.

“As a youth, he was not able to resist the influence of his Islamist friends,” said chief judge Thomas Sagebiel.

Although he still displayed the attitudes of a radical Islamist, the judge expressed hope that a youth sentence would have the necessary educational effect.

In Germany, people aged 18-21 can be treated according to youth law if they are judged to lack maturity.

The sentence was six months less than prosecutors had sought but more than the three years and three months sought by his defence lawyer, after Kreshnik B., in exchange for more lenient treatment, admitted joining Daesh and receiving weapons training.

He looked relaxed as he entered the court and looked down at his hands as the verdict was read. He was dressed casually and wore a full beard.

During his brief trial, the court heard recordings of phone calls with his sister in which he said he hoped to be a martyr.

His family had informed authorities as soon as he disappeared.

“The accused realised there were tensions between Daesh and other groups, also Islamists, and that opponents of the regime of Bashar Al Assad were fighting one another. This, as well as the pleas of his family ... was why he returned,” the court said.

Daesh militants have captured large swathes of territory in Syria and Iraq, beheaded Western prisoners, killed many non-Sunni Muslims and declared a caliphate governed by sharia law in the heart of the Middle East.

Thousands of Western volunteers have travelled to Syria and Iraq to join militant groups, raising fears in Europe and the United States of attacks by returning fighters.

About 550 German citizens have joined Islamic State and about 60 have been killed. Some 180 are believed to have returned. Prosecutors are investigating about 300 suspects.

French judges last month sentenced a returning jihadi, aged 27, who spent only days in Syria to seven years in prison.

Britain has also imprisoned people for training in Syria.

Some politicians and legal experts argue tough sentences only build resentment and more de-radicalisation programmes are essential. Authorities have also stressed how important it is to hear from disillusioned jihadis able to counter propaganda.