He was still a teenager when he wandered into one of the buildings at the dusty hilltop complex, looking for the cages where rabbits were kept.
Inside, he found a crudely equipped laboratory, with test tubes, protective masks and rows of black jars.
As Mohammed al-Masri surveyed the cluttered room, his father stepped in behind him.
"I asked my father, 'What are you doing here?' " Masri said, recalling an exchange that took place more than 20 years ago in eastern Afghanistan. His father's response was cryptic: "When you grow up, God willing, you will learn for yourself."
After the September 11, 2001, attacks, Masri's father would be regarded as one of the most ominous figures in al-Qaeda: an Egyptian with a degree in chemistry who was put in charge of the terrorist network's effort to develop mass-casualty weapons.
Abu Khabab al-Masri became the subject of a US$5 million US reward. Videos recovered from his training camp showed dogs collapsing after being sprayed with mysterious compounds. And he was linked to a series of plots - including al-Qaeda's attempt to bring down an airliner with a shoe bomb - before he was killed in a CIA drone strike.
Mohammed Masri, now 35, left Afghanistan shortly after that mid-1990s exchange in the lab at al-Qaeda's Darunta camp complex and never saw his father again. But that notorious lineage has clung to the younger Masri like a toxic residue, complicating his efforts to make his own mark as an Islamist militant, most recently in Syria.
Name recognition helped him build a following of several hundred fighters after he arrived in Syria in 2012, he said in one of a series of interviews with the Washington Post. But since then he has been caught in a violent struggle between those loyal to his father's organisation and followers of a bolder, more brutal group determined to supplant it - Isis (Islamic State).
Perhaps more than any other militant in Syria, Masri personifies this generational conflict. Isis began as an offshoot of al-Qaeda, but the two organisations are now locked in a fierce competition to determine which will prevail as the dominant brand in global jihad. At one level, their fight is over resources and recruits. But they also have competing visions for how to achieve a new era of Islamist rule, and their rivalry has the potential to fuel a terrorism arms race targeting the West.
Masri is among the few who can claim to have spent significant time at al-Qaeda's camps in Afghanistan as well as in the dystopian Isis capital of Raqqa in northern Syria - and the only person so far to emerge from those experiences and speak about them in detail.
In some ways, he represents the shared DNA of those organisations, as well as the violent disagreements over tactics and objectives that have rendered them incompatible. The course of that competition has over the past two years seemed strongly in favour of Isis. But al-Qaeda, which has escaped extermination for 15 years since the 9/11 attacks, has repeatedly shown its ability to regroup.
Al-Qaeda's main affiliate in Syria, Jabhat al-Nusra, recently declared its independence from the parent organisation, a claim that has been greeted with deep scepticism by US intelligence officials.
In a recording released in May, al-Qaeda leader Ayman al-Zawahiri urged al-Nusra in Syria to establish its own sovereign territory to compete with Isis, a move that al-Qaeda has long resisted. Zawahiri also called for a new "unity" among rebel factions arrayed against Isis and the Syrian Government, saying it is a matter of "life and death".
Masri, who knew Zawahiri in Afghanistan, is at the centre of the al-Qaeda leader's intended audience.
After failing to help avert the emergence of Isis, Masri aligned himself with the ultra-violent group in 2013, bringing other followers and accepting many of the self-declared caliphate's perks, including an apartment in Raqqa, regular pay and a new Saudi bride.
But the group gradually became aware of the limits of Masri's allegiance, he said, including his reluctance to take part in attacks against al-Qaeda's affiliate in Syria and his refusal to appear in propaganda videos denouncing his father's organisation. By mid-2014, Masri was accused of being a traitor and was being moved in and out of guarded Raqqa dwellings in Isis' version of house arrest.
Masri's lineage has led to long stretches of incarceration in his life - including eight years in Egypt. But it was someone loyal to his father's cause, a merchant in Raqqa secretly working against Isis, who helped engineer Masri's escape from the caliphate.
"My father had a big name and meaning among the mujahideen," Masri said, referring to the thousands of fighters who migrated to Afghanistan in the 1980s and 1990s. Isis "is trying to take on the [mantle] of al-Qaeda," Masri said. "They wanted to use me as a trophy."
Masri spoke on the condition that his location in the region and current affiliations not be disclosed. He also refused to be photographed, because he said he fears he could be targeted by Isis and is also at risk of arrest by various security services.
Former associates of his father and Osama bin Laden confirmed Masri's identity, and he produced his passport with his family name. In interviews, he wore a plaid flannel shirt and black hat, his legs often bouncing with nervous energy.
Masri agreed to speak to the Post, he said, in part to voice his disapproval with Isis' despotic rule over its subjects in Iraq and Syria, although he stopped short of condemning the group's brutality against the West.
"It was not that they beheaded someone who committed a crime - that was not my issue with them," he said. "It was the way they governed."
He blamed US policies and military campaigns in the Middle East for driving thousands of Muslims into the ranks of Isis. "As much as I despise Isis for the way they treat people one of the reasons they became so powerful was because of the West."
It is an echo of one of the original grievances of al-Qaeda, a terrorist organisation whose founding members were at times like an extended family to Masri.
He recalled dinners at bin Laden's compound in the late 1980s and horseback-riding competitions with the al-Qaeda leader's offspring. "I used to sit with him and his children," Masri said. "He was very relaxed, very polite and down to earth. He didn't like to talk badly about people."
Though born in Jordan, Masri had moved with his family to Pakistan by the time he was 9. His father - whose real name is Midhat Mursi al-Sayid Umar - spent much of his time across the border in Afghanistan among a constellation of training camps near the Darunta Dam, east of Kabul near Jalalabad.
To keep his family occupied, the father set up a cafe in Peshawar, a Pakistani city that served as a staging ground for thousands of Muslim men arriving from the Middle East to fight the Soviet occupation of Afghanistan.
Masri worked alongside his mother and five siblings at the restaurant, which was dubbed the Cafe Mujahideen. Its patrons were a rogues' gallery of high-ranking al-Qaeda operatives, Masri said, including Zawahiri, the longtime No. 2 who became leader of the terrorist group after bin Laden was killed in 2011.
Zawahiri and the elder Masri were part of a skilled and strident group of Egyptians who formed al-Qaeda's early core. Zawahiri was a trained surgeon, and Masri had earned an undergraduate degree in chemistry at Alexandria University. They were part of a violent movement that sought to install Islamist rule in Cairo, but the leadership fled the ensuing crackdown and eventually merged the group with al-Qaeda.
The adolescent Masri made repeated visits to see his father at the training sites, describing those trips the way American teens might depict summer sleepaways.
"It was like a holiday camp," he said of a trip to Khalden, a training camp near Tora Bora whose alumni were involved in the 1993 bombing of the World Trade Centre, the destruction of US embassies in East Africa in 1998 and other plots.
Masri said he spent two weeks at Khalden when he was 9. "We did sports in the morning," he said. "We learned that we shouldn't miss prayers and that we shouldn't go for every small thing to our parents or cry for our mothers."
Masri said his father, whom he described as patient and caring, made infrequent visits to his family in Peshawar during this period. He spoke of scenes in which his father would assemble his children around a table arranged with spices and meat and give lessons on how to combine the ingredients.
Masri was adamant that those were the only recipes he learned from his father. Asked if he had acquired expertise with toxins or explosives, he shook his head and said, "I was not the type who is very good at mixing things."
Masri, his mother and siblings left Peshawar permanently in 1996, just as bin Laden returned to Afghanistan after several years in Sudan. Masri attributed the departure to growing security concerns. Others who knew the family at the time said it was triggered by the elder Masri's decision to take a new wife.
What followed was a series of sudden moves to places including Azerbaijan, Iran and Saudi Arabia that splintered the family and left many scraping for money. Masri went from selling counterfeit watches to tourists at the Corniche seaside in Jeddah, Saudi Arabia, to working at a sweets shop in Damascus, Syria.
Then, carrying false Yemeni travel papers, he tried to go to Egypt, where he was arrested in October 2000 by authorities who were acutely aware of the elder Masri's expanding terrorism résumé and were no doubt watching for his sons.
Masri spent the next eight years in an Egyptian prison, a period during which al-Qaeda went from being seen as a second-tier security threat to the declared target of a global war. Months after the 9/11 attacks, Masri said, his younger brother, Hamzah, joined him in the Egyptian cell after being transferred from the US military prison at Bagram Air Base in Afghanistan.
There were no charges or trials. Press reports from Cairo said the two were being held out of concern for the threat they might pose but also as leverage against their father. But by then, Masri said, he hadn't had contact with his father or mother in three years.
The elder Masri is not known to have had any connection to the 9/11 plot, but anxiety about his work for al-Qaeda surged after the US military destroyed the Darunta training complex in late 2001 and uncovered alarming evidence of al-Qaeda's research of chemical weapons in the debris.
Teams of reporters who subsequently arrived at the abandoned site found laptops and documents containing recipes for sarin gas and other toxic compounds, tables specifying lethal dosages, and gruesome videos. In 2002, CNN aired footage of what appeared to be a chemical weapons experiment on caged dogs, with a voice assumed to be the elder Masri's describing the unidentified toxin's effect on the canines as they whimpered and fell.
Mohammed Masri has a selective view of his father's legacy. He maintains that the elder Masri was committed to the aid of oppressed Muslims and the ouster of Soviet forces from Afghanistan. But he insists that his father would never have tolerated the killing of civilians and never swore allegiance to bin Laden.
"He did not agree with killing innocent people," Masri said. "He used his knowledge to defend the oppressed."
There is some evidence that the elder Masri kept an arms-length relationship with the terrorist group. Internal al-Qaeda letters maintained by the Combating Terrorism Centre at West Point depict the elder Masri as a mercenary, angering his superiors at times for pocketing cash he was supposed to put towards research.
One of his contemporaries, Osama Rushdi, told the Post in 2007 that the elder Masri worked with al-Qaeda for salary and rent only after the Egyptian groups in Afghanistan dissolved. "He found himself inside this fire without having any real choice," said Rushdi, who has lived for years in exile in England.
"He did not agree with killing innocent people. He used his knowledge to defend the oppressed."
Whatever his motivation, the elder Masri came to be seen by U.S. counterterrorism officials as one of al-Qaida's most dangerous assets. Records obtained at Darunta by the Wall Street Journal traced the origin of al-Qaida's chemical weapons program, describing how he had been given as much as $4,000 in seed money in 1999 to launch what the files referred to as Project al-Zabadi, Arabic for curdled milk.
And while al-Qaida's efforts to develop chemical, biological or even nuclear munitions ultimately fizzled, the elder Masri's expertise with explosives factored in a series of post-9/11 plots. U.S. officials still suspect he played a role in training and equipping Richard Reid, who remains in a U.S. prison after attempting to detonate a bomb hidden in his shoe aboard a Miami-bound aircraft in 2001.
By 2005, the United States was offering a $5 million reward for information on the elder Masri, and as the CIA's drone program intensified, he was among its top targets.
A 2006 strike near the Pakistani village of Damadola was initially thought to have killed him, but he later resurfaced. A second attempt in July 2008 was followed by an al-Qaida eulogy describing him as a hero who had joined "the caravan of martyrs."
Mohammed Masri was still in prison when he learned of his father's death. The reason for the brothers' incarceration expired with that news, and within months they were released.
Three years later, the Arab Spring uprising brought an end to the Egyptian Government that al-Qaeda could never induce. Masri was enthralled by the unfolding history but saw no role for himself until Syria erupted in civil war.
Masri was part of a vast stream of young Muslim males who surged into Syria in 2012 from across the Middle East and Europe, but he had a backstory that set him apart: experience at training camps in Afghanistan, a stint in an Egyptian prison and a bloodline from a respected jihadist who had been killed in a CIA drone strike.
The credentials helped Masri establish himself in an emerging militant network and claim a meaningful role in early military successes. By his account, he was part of a force that helped liberate the Bab al-Hawa region along Syria's northern border with Turkey from the control of Syrian President Bashar al-Assad.
Masri also made a powerful connection during these early months, meeting and forming a close bond with Omar al-Shishani, a former soldier in the Georgian military who had been trained by US Special Operations forces.
Ousting Assad was at first a unifying cause for the disorganised militias forming in Syria. But soon they were turning on one another, a competition for primacy that favoured the most battle-experienced and ruthless organisation in the mix. Made up of Iraqi military veterans and former al-Qaeda lieutenants, Isis went on a 12-month tear in which it conquered much of Iraq and Syria, smashing or absorbing militias that got in its way.
Masri said he was dismayed by Isis' destructive impact on the rebellion against Assad, as well as the arrogance of leaders convinced that they were qualified to declare a restored caliphate and pass judgment on who should be considered faithful Muslims. "These are the worst takfiri on the planet," Masri said, using a religious term for those who seek to excommunicate other Muslims, a practice that many regard as the province of the divine.
Masri said he sought to keep Shishani and the Georgian's 800 followers from joining the juggernaut and declaring allegiance to Islamic State leader Abu Bakr al-Baghdadi. "But he didn't listen to me," Masri said, describing Shishani's conversion as a brainwashed submission: "He drank the soup."
Ideologically, al-Qaida and the Islamic State are virtually indistinguishable, focused on the return of an empire that abides by the strictest interpretation of Islam. But the two have violently different views on how to achieve this, with al-Qaeda envisioning a long campaign that is aimed primarily at the "far enemy," or the West, and can't afford to alienate other Muslims. Isis, by contrast, sees no reason to delay the reestablishment of the ancient caliphate.
Isis has already outstripped al-Qaeda in critical categories: recruiting more followers, seizing more territory, inspiring more attacks and causing more anxiety in the United States. Even so, Isis often seems to suffer from a jihadist inferiority complex, devoting disproportionate energy to denigrating al-Qaeda and mocking the older network's aging leadership.
Issues of Dabiq, Isis' English-language online magazine, routinely include insults aimed at Zawahiri. A cover story was devoted to an al-Qaeda defector recounting his time in Pakistan and heaping scorn on his former peers.
Masri followed his powerful ally Shishani, an ethnic Chechen, into the Isis fold. But the group appears to have struggled to figure out what to do with the al-Qaeda progeny, who had an impressive pedigree but neither the chemistry skills nor the leadership mantle of his father.
Masri said he was given an apartment on a prominent circle in Raqqa where Isis routinely carried out beheadings. Masri left behind a wife and a child to enter Syria and declined to discuss whether he has any continuing connection to them. But he was provided a new bride, weapons, clothes and cash by the caliphate.
These provisions were contingent on a level of commitment and cooperation that Masri seldom demonstrated. He argued with commanders and the caliphate's judicial officials. He repeatedly delayed pledging "bayat," or allegiance, to Baghdadi and frequently found excuses to avoid being on the front lines of fights against the group's nemesis: Jabhat al-Nusra.
After being sent several times to indoctrination sessions that lasted multiple days and were supposed to solidify his support for the caliphate, Masri angered superiors by abruptly leaving for Turkey. At that point, he could have stayed out of Isis' reach, but the organisation lured him back with a ploy that preyed on his arguably inflated sense of importance.
"Omar called," Masri said, referring to Shishani. "You are dear to me," the Georgian said, according to Masri's account. "Please rethink your decision. There should not be such problems. It can go back to the way it was."
Ensured of his safe passage, Masri in March 2014 returned to Raqqa, where the error of his decision became obvious when he arrived at Shishani's residence. Guards blocked the entrance and made clear that the Isis commander - who has since died of wounds suffered in a 2016 US airstrike in Syria - wanted Masri to stay away.
I understood if I made a wrong move they would kill me
Masri said he was then subjected to a cycle of being arrested, detained for days and then - after new pledges of compliance - released. But he said he was never allowed to leave the caliphate. His weapons, apartment and phone were seized, and his marriage terminated.
"I understood if I made a wrong move they would kill me," Masri said.
At one point, Masri said he had been handcuffed and blindfolded for two days when a regional Isis commander arrived and asked Masri if he would be willing to record a propaganda video praising the caliphate and denouncing his father's organisation.
"Yes, yes, I will do a very nice video," Masri replied. Rather than being dragged before the camera at knifepoint - the fate of many Western captives - Masri was inexplicably given another reprieve.
At the urging of sympathisers whom he declined to identify, Masri made contact with a shopkeeper in Raqqa who was part of a hidden network of dissidents inside the caliphate. The merchant was familiar with the elder Masri's role in Afghanistan and surreptitiously made calls to arrange the son's escape.
Days later, well after nightfall, the merchant drove Masri to a safe house with ties to Ahrar al-Sham, a group that itself is linked to al-Qaeda's branch in Syria. After two days there, Masri was disguised in Bedouin robes and smuggled by motorcycle to the Turkish border early last year.
Masri said he is still trying to help "the Syrian people to be free" but declined to say how.
While his father once ranked as a "high-value target" on CIA kill lists, Masri appears to have barely surfaced on the databases of Islamist militants maintained by US spy agencies. US officials indicated that he was not a wanted terrorism suspect, although he is likely on US and European no-fly lists.
All that happened to my brothers and me was because of who my father was
Masri spoke with reverence about his father but also betrayed bitterness towards the man who put his Islamist agenda ahead of his family. In addition to the two sons who spent years in prison, a third was reportedly killed alongside him in the 2008 drone strike.
"All that happened to my brothers and me was because of who my father was," Masri said. "He is in heaven now, and I pray to God after Judgment Day I will see my father again."
Asked whether he would like his own children to take after their grandfather, Masri said, "No, they should finish their school. I wish for them to become doctors and engineers. They can live a normal life."