Relatives carry pictures of Kurdish People's Protection Units (YPG) fighters, who were killed when Islamic State militants attacked the town of Tel Abyad on the Turkish border, during their funeral in the countryside of the town of Derbasiyeh, Syria March 2, 2016. Reuters

A British man fighting in Syria killed himself before being captured by the Islamic State group, also known as ISIS, as he fought alongside Kurdish forces.

Ryan Lock, 20, was involved with the Kurdish People's Protection Units (YPG) and their campaign to oust ISIS from its de facto headquarters of Raqqa in northern Syria when his unit came under ISIS fire Dec. 21 near the village of Ja'bar. Lock and four others were reportedly surrounded near the historic castle located by lake Assad and "showed considerable resistance" before being overtaken, BBC News reported Tuesday. The outlet quoted Kurdish forces as saying that a "trace of a gunshot wound was found under the chin," indicating he had shot himself rather than inevitably being captured.

Lock worked as a chef and had no prior military experience before traveling in August to the Kurdish region of Rojava in Syria, according to The Guardian. He enlisted Sept. 4 with the YPG and took the name Berxwedan Givara, meaning “resistance Guevara,” in reference to Argentine communist militant Che Guevara who was instrumental in the Cuban Revolution. Most of his unit had reportedly been killed by a Nov. 24 Turkish airstrike that took the lives of a dozen YPG fighters including three foreigners - a U.S. citizen, an Israeli citizen and a German citizen. A Canadian citizen, Nazzareno Tassone, who was called "Agir Ararat," was killed alongside Lock in last month's attack, according to Kurdish media outlet Rudaw.

"Ryan was a very caring and loving boy who would do any thing to help anyone. He had a heart of gold. We ask for privacy to allow our family to grieve," Lock's father, Jon Plater, said last month in a statement.

See posts, photos and more on Facebook.

Lock's body was initially in the hands of ISIS militants before being recovered and returned Tuesday to the U.K. with the help of YPG fighters, whom Plater thanked. Despite a travel advisory from the U.K.'s Foreign Office urging nationals to avoid travel to Syria, Lock was the third person from the U.K. to be killed in the fight against ISIS.

“Comrades Agir and Berxwedan will be the leaders of our struggle and we will remember them in every moment of our life,” the YPG wrote in a statement last month.

While the U.K. supports the U.S.-led coalition against ISIS in Syria, British forces' only direct airstrike launch was an unmanned Reaper drone strike near Raqqa on Christmas Day. The U.S., once supportive of Syrian rebels fighting Syrian President Bashar Assad, focused its efforts toward fighting ISIS and has supported Kurdish forces in the past via air support. Turkey has coordinated with both the U.S. and Russia in its own campaign against ISIS, but routinely targets Kurdish positions as well, fearing calls for the establishment of an autonomous Kurdish state on its border with Syria that would bolster its own restive Kurdish minority.