As the sun rose on what promised to be a sweltering day in Kabul, the most wanted man in the world stepped onto his balcony to enjoy the crisp dawn breeze.
It was a surprisingly careless decision for a terrorist who had spent his entire adult life playing a game of cat and mouse with international authorities.
But Ayman al-Zawahiri, who wore disguises and hid in caves and relied on a network of loyalists to stay alive, risked it all for a breath of fresh air.
It would be his last.
At exactly 6:18am in Kabul, as Zawahiri stood on the balcony of his safe house, the US Central Intelligence Agency was watching and waiting.
An unmanned drone hovering in the skies over Kabul unleashed two Hellfire missiles in what US officials claim was a "precise and calibrated strike" targeting one man.
"The strike that killed Al Qaeda leader Ayman al-Zawahiri is a major success of US counterterrorism efforts, a result of countless hours of intelligence collection over many years," Mick Mulroy, a former CIA officer and senior Pentagon official, told the New York Times.
"He likely believed we would never be able to track him down. But he was wrong."
Just like Osama bin Laden, his former leader, Zawahiri's luck in eluding the United States finally ran out.
But despite the terror he unleashed on the world, Zawahiri could never quite achieve his predecessor's status as a global supervillain of mythic proportions.
How did he become bin Laden's right-hand man?
Ayman al-Zawahiri grew up in Cairo, in a rich and well-connected family with links to political, scholarly, religious and even royal elites.
A devout child, he became interested in political activism as a teenager, and by 15 had already been arrested for his membership of the extremist Muslim Brotherhood group.
Following in his father's footsteps, he studied medicine at Cairo University and went on to train as a specialist surgeon. It was, in part, this background that set him on the path to meet his future leader.
In the 1980s, Zawahiri was leading the Egyptian Islamic Jihad, a group known to target high-ranking public officials in their goal to overthrow the government.
He served three years in prison over his involvement in aiding the assassination of Egyptian president Anwar al-Sadat.
Once freed, he fled the country for Pakistan, where he treated mujahideen casualties escaping Russia's invasion of Afghanistan and reportedly first met a tall young Saudi named Osama bin Laden.
The two are said to have struck up a close relationship, having come from well-educated, wealthy families.
"There was something that resonated between these two youngsters on the neutral ground of faraway Afghanistan," sociologist and human rights activist Saad Eddin Ibrahim told The New Yorker in 2002.
"There they tried to build the heavenly kingdom that they could not build in their home countries."
By 1998, Zawahiri's extremist faction had officially joined with Al Qaeda, with the doctor signing a joint fatwa with bin Laden calling on Muslims to kill Americans and their allies.
He became a personal adviser and physician to bin Laden, and was seen as the Al Qaeda leader's top lieutenant and right-hand man.
"He was not a military man by background, but he was one of the big brains in terms of being a strategic thinker within the Al Qaeda movement," counter-insurgency expert David Kilcullen told the ABC.
Zawahiri would go on to become one of the world's most wanted men, widely seen as the mastermind behind Al Qaeda's bombings of US embassies and Navy assets, and most infamously, the September 11 attacks on the World Trade Center and the Pentagon.
So when bin Laden was finally tracked down by US special forces and assassinated in 2011, Zawahiri became Target Number 1.
The hunt for a terrorist
Reports of assassination attempts and rumours of Zawahiri's death have circulated for more than a decade.
In 2006, following a years-long manhunt for the terrorist leader, US officials finally believed they had caught their man hiding in the North West Frontier Province, near Pakistan's border with Afghanistan.
A volley of Hellfire missile strikes was launched and reports soon surfaced of the possible death of the second-in-command among 11 others.
But Pakistani officials were doubtful the terrorist leader was dead, and two weeks later video confirmed Zawahiri was alive and unhurt.
In the footage aired by Al Jazeera, he taunted US officials over the strike, warning that Bush nor "all the powers on Earth" could bring his death "one second closer."
Two years later, US authorities were on Zawahiri's trail once again, using a double agent in Pakistan to penetrate the core of Al Qaeda in the hopes of finding a path to the second-in-command.
The source claimed he was close to Zawahiri, prompting officials to set up a meeting in a secure location in Khost, Afghanistan, only to discover that the man was in fact a triple agent who had lured officials into a trap.
The man detonated his shrapnel-filled device soon after he arrived, killing seven officers and two contractors in a devastating attack that prompted a scathing investigative report.
It's not clear how many more assassination attempts Zawahiri may have survived, but the doctor-turned-radical is suspected of playing a cat-and-mouse game with officials for years.
For most of that time his whereabouts has been something of a mystery, with the leader linked to Pakistan's tribal area or in the sparsely populated remote area around the Pakistan-Afghanistan border.
A master of disguise, Zawahiri travelled in small groups dressed in local garb so they could slip past authorities undetected.
Members of his team also married key figures in local tribes to secure his protection and reportedly used special imaging technology to hide his location in videos released to the public.
As the years ticked by, the search for Zawahiri continued.
"We never hear about the hunt for him because it's conducted in secret, but that doesn't mean that [the] CIA isn't looking for him," Peter Bergen, author of Manhunt: The Ten-Year Search for bin Laden From 9/11 To Abbottabad, told CNN in 2018.
Despite more than a decade on the run, officials were hopeful that Zawahiri's capture was only a matter of time.
"We can be quite patient," an official told NBC in 2016.
The cat-and-mouse game that ended in a sloppy mistake
Like Osama bin Laden before him, initial reports indicate Zawahiri got a little cocky in his final years.
Bin Laden was eventually undone when the CIA was tipped off by a source about a mysterious compound in Pakistan.
Their surveillance found that a tall man, who they nicknamed "the Pacer", shuffled back and forth on a balcony shielded by a privacy wall.
The evidence was circumstantial but it was enough to prompt then-president Barack Obama to send in Seal Team Six.
Eleven years later, a mix of intelligence and surveillance also finally ended the manhunt for Zawahiri.
A breakthrough came earlier this year when US counterterrorism professionals discovered Zawahiri's family — including his wife, daughter and grandchildren — had been relocated to an urban safe house located in a suburb popular with Taliban officials in Kabul.
It took several more months to confirm his presence, a senior administration official told journalists in a private background call.
President Joe Biden was first briefed on the situation by his National Security Advisor Jake Sullivan in April and updated frequently as the intelligence evolved.
"Once Zawahiri arrived at the location, we are not aware of him ever leaving the safe house," the official said.
"We identified Zawahiri on multiple occasions for sustained periods of time on the balcony where he was ultimately struck."
Analysts mapped the property, noting its occupants and the terrorist leader's daily habits, while paying close attention to the hideout's layout and construction ahead of a possible operation.
Wary of leaks, a close circle of top officials planned the operation in secret, updating the President throughout May and June.
On July 1, Mr Biden was briefed on the proposed operation in the White House by key members of his cabinet, including the CIA director, the director of national intelligence, the national counterterrorism centre director.
He was shown a model of Zawahiri's safe house and asked detailed questions, including about the structural integrity of the building, apparently focused on "minimising the risk to civilians, including Zawahiri's family," according to the official.
"He was particularly focused on ensuring that every step had been taken to ensure the operation would minimise that risk," the official said.
In a subsequent meeting on July 25, Mr Biden received a final briefing on the intelligence assessment, before authorising "a precise, tailored airstrike" as soon as an opportunity arose.
In the early hours of July 31, the moment arrived after 21 years of searching, when the terrorist leader stepped onto his balcony for the final time.
For a man who had spent years hiding in remote areas of Pakistan and Afghanistan, successfully evading the watchful eye of international intelligence agencies, his discovery on a balcony might have appeared sloppy.
But to experts, it was a hallmark of just how emboldened Al Qaeda have become after the withdrawal of US troops in Afghanistan.
"Al Qaeda have effectively been operating in the open with impunity for a year in Afghanistan, giving the lie to the Taliban's promise during the peace negotiations that they would cut their relationship with Al Qaeda," Professor Kilcullen said.
"So in fact, although it's obviously — as the President said — ties up some loose ends with respect to 9/11, he's just one of dozens, possibly hundreds, of senior Al Qaeda members now busily putting the safe haven back together in Afghanistan."
Already US politicians are warning that while the strike has delivered a "gut punch" to Al Qaeda, Sunday's actions don't mean the organisation is done.
"There will be someone to come and replace him. He may already have had a successor he was grooming," Republican congress member Adam Kinzinger said.
The search for a successor
The question of succession was already vexing Al Qaeda long before the rockets hit Zawahiri.
He was reported to be in ill health for years, fuelling speculation that the terrorist network would be making its third leadership transition sooner rather than later.
The assassination does little to hurt the group, which has already been sliding into relative obscurity, according to Professor Kilcullen.
"It's a big symbolic hit, and it ties up the loose ends from 9/11," he said.
"But there's a new generation of Al Qaeda leaders in the operational space who've come up over the last 20 years, including one of the sons of Osama bin Laden and a number of other, what you might call next-generation Al Qaeda leaders."
Professor Kilcullen said Al Qaeda lost its status as "top dog in the global jihadist ecosystem" long ago.
"That place has been taken by the Islamic State and by other groups — in particular, the two Shabaabs — al-Shabaab in Somalia and al-Shabaab in Mozambique, who are some of the fastest-growing terrorist groups."
Zawahiri was often criticised for being "incompetent" and "uncharismatic".
But given US officials once declared that bin Laden's death had left his group "a shadow of its former self", the fact that Zawahiri kept the group alive at all led some counterterrorism experts to declare: "If Osama bin Laden were alive today, he'd likely be a happy man."
For Mr Biden, the significance of this assassination is clear.
"He carved a trail of murder and violence against American citizens, American service members, American diplomats, and American interests," he said in a brief statement on the White House balcony.
"Now, justice has been delivered. And this terrorist leader is no more."
As Zawahiri joins bin Laden in death, a new era begins in the post-war relationship between the US and Afghanistan.
The men fighting this old ideological battle continue to change.
But this war appears to be far from over.