On July 27 2002 in a remote region of Afghanistan near Pakistan's border, US Special Forces surrounded a suspected al-Qaida compound near Khost. When requests to have the occupants come out went unanswered, two Afghan soldiers fighting alongside the elite American team offered to go in and translate.

Entering, they were immediately shot dead. This sparked a lengthy battle that required US air support before the compound crumbled.

When everything became quiet, the soldiers moved carefully forward to search for survivors. Sergeant Mike Silver would later recall that he heard the popping sound a grenade makes when lit before the explosion.

The grenade landed near Sergeant Christopher Speer, who would die 10 days later from the shrapnel wounds.

A post-battle report quoted an unnamed commando as saying: "He heard moaning coming from the back of the compound. The dust rose up from the ground and began to clear, he then saw a man facing him lying on his right side. The man had an AK-47 on the ground beside him and the man was moving. [A commando] fired one round striking the man in the head and the movement ceased."

Then the soldier saw another body moving and fired two rounds, which hit the back of Omar Khadr, leaving two gaping holes as they exited through his chest. Shrapnel hit his eyes, partially blinding him. Once dragged from the rubble, soldiers gave Khadr medical treatment, incredulous they had captured a 15-year-old who spoke English.

The Pentagon would later allege that a month before that battle, Khadr, a Canadian citizen, had been sent by his father, Ahmed Said Khadr, to undergo weapons training and fight with al-Qaida. A video later uncovered at the scene of the battle shows him making improvised explosive devices.

Once captured, the 15-year-old was taken to the US base in Bagram, Afghanistan. Three months later, on October 28 2002, he was moved to Guantánamo.

The world had its first glimpse of Khadr this week in the interrogation video obtained by his Canadian lawyers. Filmed at Guantánamo in 2003, it shows more than seven hours of interrogations during which Khadr appears sometimes defiant, sometimes despondent and often desperate. "Promise me you'll protect me from the Americans," he pleads. But the chief interrogator from Canada's spy agency wasn't there to help. He wanted information.

When Khadr is left alone, a camera hidden in an air duct in the small interrogation room continues to roll. He sobs and holds his head but the poor audio quality of the recording makes it difficult to determine what he's moaning. Some hear "kill me," while others believe it's "help me." It sounds most like ya ummi, Arabic for "my mother".

Now 21, the Toronto-born Khadr is to be tried at Guantánamo on five war crimes charges in October. The Pentagon alleges he conspired with al-Qaida and that he threw the grenade that killed Speer.

Canada's prime minister, Stephen Harper, has vowed not to interfere in the US prosecution. But the case has international significance because of the light shed by the video on interrogation practices, and because Khadr, Canada's only Guantánamo detainee, is now the sole prisoner there with western citizenship after Britain and other US allies secured the release of their nationals.

International law states that those under 18 captured in armed conflict deserve protection. Canada has been a leader in protecting the rights of child soldiers. Yet advocacy for former UK residents held at Guantánamo, including Ethiopian national Binyam Mohamed, has exceeded any pressure Canada has exerted concerning Khadr. Canada's Conservative minority government is now in an uncomfortable position, even with public opinion on its side.

From the moment Omar Khadr was born on September 19 1986, he was his mother's favourite child. She called him yasser, Arabic for "comfort" or "easy". He was Maha Elsamnah's fifth child, born in a Toronto hospital. But her thoughts, even during labour, were across town at a the children's hospital where her 14-month-old son Ibrahim was about to undergo heart surgery. She had been on the way there when the contractions started. She didn't want to leave Ibrahim, but Omar wasn't waiting.

When Ibrahim was born with a heart defect, she already had three young children - a daughter, Zaynab, and two sons Abdullah and Abdurahman.

The family lived in Peshawar, Pakistan, where her husband ran a charity. But they came back often to Canada's largest city to visit Elsamnah's parents, and her children were born there, making them Canadian citizens. Still, Peshawar was home, even though Elsamnah was born in Egypt to Palestinian parents and carried Canada's blue passport.

Like other Muslims drawn to Peshawar, the couple were at first attracted by the excitement of the capital of the North-West Frontier Province and the fight against the Soviets who occupied Afghanistan. Khadr was an engineer by training but also a persuasive speaker who had a gift for raising money. In Peshawar, he was known as al-Kanadi, the Canadian, and life was a hectic routine of travel, war and fundraising.

During Omar's childhood his family moved often between Pakistan, Afghanistan and Canada. Ibrahim was sent to live permanently with his grandparents in Canada, where he later died.

Omar and his remaining five siblings became comfortable in both worlds, but Omar was especially fond of Canada's liberal society and western movies - including action films such as Die Hard.

But his father had started to change. In 1992 Ahmed Said Khadr nearly died after stepping on a landmine in Afghanistan. He had become determined to see an Islamic government in Afghanistan. He became more involved in politics, and the Pakistani authorities were starting to become wary of his increasing militancy. They knew he had met many powerful leaders during the Soviet occupation. He knew Osama bin Laden, who had left Pakistan for Saudi Arabia and then Sudan after the Soviets withdrew, but who would return to Afghanistan and lead al-Qaida once the Taliban took power.

In 1995, Khadr was among those arrested for the November 19 bombing of the Egyptian embassy in Islamabad that killed 16 and injured 60. Pakistan's authorities suspected Ayman al Zawahiri, an Egyptian, was the mastermind, and Khadr the financier. But little evidence was produced and Khadr went on a hunger strike to protest his detention.

His case garnered sympathy in Canada, where he was portrayed as a charity worker being held without trial. Canada's then prime minister, Jean Chrétien, intervened personally and demanded that Khadr be given a fair trial or released. A few months later, Pakistani authorities relented and Khadr was freed. But Chrétien was harshly criticised after the attacks of September 11 2001, when it was revealed that America and the UN had listed Khadr as a suspected al-Qaida financier.

In the late 1990s Khadr moved his wife, four sons and two daughters to Afghanistan. Although Khadr continued his charity work, he also reignited his friendship with Zawahiri and Bin Laden and sent Omar's older brothers to militant training camps. Abdurahman was captured by the Northern Alliance and turned over to the US authorities. But Omar was considered too young, so most often stayed home with his mother, sisters and younger brother.

When 9/11 happened, the Khadr family was living in Kabul, and as the US invaded Afghanistan they fled to the mountainous border region with Pakistan. It is from here, the US prosecutors allege, that Omar Khadr was sent to join al-Qaida fighters the following summer.

The 15-year-old was held at Bagram for three months by the Americans, and some days was questioned for as long as eight hours at a stretch. His chief interrogator, US Sergeant Joshua Claus, would later be convicted for his role in the death of another detainee at Bagram - an Afghan taxi driver named Dilawar.

During an interview after he left the military, Claus said Khadr's interrogation was different, and he denies any allegations of abuse. But Khadr, in an affidavit to his lawyers but which the Pentagon censored before being made public, said he was afraid of his interrogators. "I figured out right away that I would simply tell them whatever I thought they wanted to hear in order to keep them from causing me (censored)."

British detainee Moazzam Begg befriended Khadr while in custody and was shocked by the way the guards treated him. "I remember eventually when I moved into a cell with him, his acceptance of his fate, what had taken place, the knowledge that he pretty much lost his family," Begg said. "Out of all the people I've ever met in incarceration, my heart bled for him the most."

On October 28 2002, Khadr was taken to Guantánamo. "For two nights and one day before putting us on the plane, we were not given any food so that we would not have to use the bathroom on the plane," he later wrote in his statement.

Begg vividly remembers their last conversation before he left. "There are people who actually are concerned about you," Begg recalled Khadr as saying. "I don't have anyone."

During his years at Guantánamo, the interrogations continued. Khadr alleges that one day when he refused to answer questions, his hands and feet were cuffed together behind him. When the guards returned and found he had urinated on himself, "[The] military police poured pine oil on the floor and on me, and then, with me lying on my stomach and my hands and feet cuffed together behind me, the military police dragged me back and forth through the mixture," he claimed in his statement. The Pentagon denied the allegations.

By 2007, Khadr had spent almost a quarter of his life in Guantánamo. He was confined in the isolation wing where a toothbrush was considered a privilege. His lawyers feared he was suicidal.

On October 8 he is scheduled to make history when he goes before a panel of military jurors as the first person to be tried for alleged war crime offences while a minor. He will be 22.

His lawyers argue that he should be treated as a child soldier and rehabilitated, not prosecuted.

His father was killed in October 2003 by Pakistani forces in an attack which also paralysed his younger brother. The rest of the family has since returned to Canada, where Abdullah is in prison fighting extradition to the US on terrorism charges, and Zaynab is being investigated. Two younger siblings are still in high school.

The lack of sympathy for the family can partly be put down to a documentary aired by the Canadian Broadcasting Company in 2004, in which Abdurahman, then 21, confessed to working for the CIA after his capture, disclosed his father's connections to Bin Laden and said he grew up in an "al-Qaida family".

But what especially enraged Canadians were the comments made by Omar Khadr's mother and older sister. "You would like me to raise my child in Canada and by the time he's 12 or 13 he'll be on drugs or having some homosexual relation or this and that? Is it better? For me, no," Elsamnah told the interviewer.

When asked for her reaction to the 9/11 attacks, she said: "Since I am Palestinian and I know the Americans are helping the Israelis so much, I said, 'Let them have it. It's time that they,' I don't want you I ..." But Zaynab continued her mother's unfinished sentence, saying: "Not the people themselves. You don't want to feel happy, but you just sort of think, 'Well, they deserve it. They've been doing it for such a long time, why shouldn't they feel it once in a while?'"

Whereas Canadian public opinion had supported Ahmed Said Khadr when he was incarcerated in Pakistan, the family were now labelled "Canadians of convenience" - happy to take advantage of the country's medical system and passports, but disdainful of its liberalism.

The video this week seemed to tip the balance of public opinion in Omar Khadr's favour but Prime Minister Harper said he would not criticize Guantánamo's trials. "We're this far along so let's see this thing through and get a judgment and whatever happens past that point of judgment happens," his spokesman said.

· Michelle Shephard is the defence reporter for the Toronto Star and is author of Guantánmo's Child: The Untold Story of Omar Khadr, published by Wiley £15.99.