Shamima Begum, who fled the UK and joined the Islamic State group, was smuggled into Syria by an intelligence agent for Canada.

Files seen by the BBC show he claimed to have shared Ms Begum’s passport details with Canada, and smuggled other Britons to fight for IS.

Ms Begum’s lawyers are challenging the removal of her citizenship, arguing she was a trafficking victim.

Canada and the UK declined to comment on security issues.

Ms Begum was 15 when she and two other east London schoolgirls – Kadiza Sultana, 16, and 15-year-old Amira Abase – travelled to Syria to join the IS group in 2015.

At the main Istanbul bus station, the girls met Mohammed Al Rasheed, who would facilitate their journey to IS-controlled Syria.

A senior intelligence officer, at an agency which is part of the global coalition against IS, has confirmed to the BBC that Rasheed was providing information to Canadian intelligence while smuggling people to IS.

The BBC has obtained a dossier on Rasheed that contains information gathered by law enforcement and intelligence, as well as material recovered from his hard drives, which provide extraordinary detail about how he operated.

He told authorities that he had gathered information on the people he helped into Syria because he was passing it to the Canadian embassy in Jordan.

Rasheed, who was arrested in Turkey within days of smuggling Ms Begum to IS, told authorities he had shared a photo of the passport the British schoolgirl was using.

The Metropolitan Police were searching for her, although by the time Canada received her passport details, Ms Begum was already in Syria.

The dossier shows that Ms Begum was moved to Syria through a substantial IS people-smuggling network that was controlled from the group’s de-facto capital in Raqqa.

Rasheed was in charge of the Turkish side of this network and facilitated the travel of British men, women and children to IS for at least eight months before he helped Ms Begum and her two friends.

Ms Begum told the BBC’s forthcoming I’m Not A Monster podcast: “He organised the entire trip from Turkey to Syria… I don’t think anyone would have been able to make it to Syria without the help of smugglers.

“He had helped a lot of people come in… We were just doing everything he was telling us to do because he knew everything, we didn’t know anything.”

Rasheed kept information about the people he helped, often photographing their ID documents or secretly filming them on his phone.

One recording shows Ms Begum and her friends get out of a taxi and into a waiting car not far from the Syrian border.

Rasheed also gathered information about IS, mapping the locations of the homes of Western IS fighters in Syria, identifying IP addresses and locations of internet cafes in IS-controlled territory, and taking screenshots of conversations he was having with IS fighters.

In one conversation, Rasheed spoke to a man believed to be notorious British IS fighter and recruiter, Raphael Hostey, who says to him: “I need you to work under me. Officially… I want you to help us bring people in.”

In a follow-up text, Rasheed asks Hostey: “Can you explain a little, please?”

Hostey says: “Same thing that you’re doing now, but you work for us bringing equipment, bringing in brothers and sisters”. Mohammed Al Rasheed replies: “I am ready, brother.”

Rasheed was arrested in the Turkish city of Sanliurfa not long after he had facilitated the girl’s journey to Syria.

In a statement to law enforcement, he said that the reason he had gathered information on everyone he had helped, including Shamima, was because “I was passing this information to the Canadian embassy in Jordan”.

Rasheed said that in 2013 he had gone to the Canadian Embassy in Jordan to try to apply for asylum. He said: “They told me they were going to grant me my Canadian citizenship if I collect information about the activities of ISIS.”

The BBC has been able to confirm that Rasheed passed in and out of Jordan multiple times between 2013 and his arrest in 2015.

Tasnime Akunjee, the lawyer for the Begum family, said there will be a legal hearing in November to challenge the removal of Ms Begum’s citizenship and “one of the main arguments” will be that then-Home Secretary Sajid Javid did not consider that she was a victim of trafficking.

“The UK has international obligations as to how we view a trafficked person and what culpability we prescribe to them for their actions,” he said.

Mr Akunjee said it was “shocking” that a Canadian intelligence asset was a key part of the smuggling operation – “someone who is supposed to be an ally, protecting our people, rather than trafficking British children into a war zone”.

“Intelligence-gathering looks to have been prioritised over the lives of children,” he said.

Shamima Begum is now held in a detention camp in north-east Syria. Her citizenship was taken away in 2019 after she emerged from the ashes of the so-called IS caliphate.

A British government spokesperson said: “It is our long-standing policy that we do not comment on operational intelligence or security matters.”

Defence Secretary Ben Wallace said he could not “comment on intelligence matters”, but added that “at the moment” he did not recognise “what’s being reported”.

Canadian Prime Minister Justin Trudeau said intelligence services needed to be “flexible” and “creative in their approaches” to fight terrorism, but “they are bound by strict rules”.

“We will continue to ensure that proper oversight is done, and as necessary look at further steps”, he added, while speaking at a press conference in Ottawa.

A Canadian Security Intelligence Service spokesman said he could not “publicly comment on or confirm or deny the specifics of CSIS investigations, operational interests, methodologies or activities”.