A British man who died in Syria after travelling to the war-torn country to fight IS is believed to have shot himself to avoid capture by the terror group

Ryan Lock, who left his job as a chef to join anti-IS forces in war-torn Raqqa, was killed during an offensive to retake the city just 10 days before he was due to return home for Christmas.

The 20-year-old, from Chichester, West Sussex, turned his gun on himself to avoid being taken prisoner by IS and used as a propaganda tool, Kurdish sources told the BBC.

Ryan Lock was wounded in a previous attack

His body is expected to be repatriated to Britain after being recovered by his comrades and received during a military ceremony by pro-Kurdish fighters.

Lock, who had no previous military experience, joined the People's Protection Units, known as the YPG.

He reportedly told his family he was going on holiday to Turkey when he left Britain in August.

Lock's father Jon Plater confirmed reports his son committed suicide to avoid falling captive to IS. "We did know. It is true - 100%," he said.

In a statement, Plater said: "Since we heard the devastating news of Ryan, it's been pretty tough, especially the difficulties surrounding the repatriation.

"We are grateful to the YPG for bringing him home."

Ryan Lock posing with a gun in Syria

Sources told the BBC that an examination showed that "it seems that the British fighter committed suicide in order not to fall captive with Isis".

A report said the gunshot wound indicated "that the gun made contact with the bottom of the chin".

Using Lock's nom de guerre, YPG general command member Mihyedin Xirki described him as a "martyr" who died "putting up a brave fight".

He said: "We bless the resistance of British martyr Berxwedan Givara for the families of all martyrs and the British people. Our martyr fell putting up a brave fight."

A military ceremony attended by dozens of pro-Kurdish fighters, representatives from political parties and NGOs was held in Rojava on Tuesday.

Ryan with his friend Michael who was also killed

Photos of the ceremony showed a coffin displaying a photograph of Lock and a Union flag surrounded by armed militia.

Mark Campbell, a Kurdish rights campaigner, said on Facebook: "UK YPG volunteer Ryan Lock's body passed over the border of Rojava to KRG (Kurdish Regional Government) region with military honours today (Tuesday) to begin his journey home to his family and friends for burial in the UK."

Our thoughts today are very much with his mother, father and whole family at this difficult time and very much hope that the repatriation process in Erbil will be speedy so the family can have Ryan home, as soon as possible, for burial. Mark Campbell, Kurdish rights campaigner

The British Foreign and Commonwealth Office advises against all travel to Syria.

Lock is the third British man to die fighting IS with the Kurds in Syria.

Dean Evans, 22, a dairy farmer from Reading, Berkshire, died in the city of Manbij in July last year and former Royal Marine Konstandinos Erik Scurfield, 25, from Barnsley, South Yorkshire, died in the northern village of Tel Khuzela in March 2015.