On September 11, 2001, the militant Islamist group al-Qaeda became a household name.
Having already garnered some infamy for its attacks on United States embassies in east Africa in the late 1990s and bombing the USS Cole in October 2000, the attacks on 9/11 made the organisation the global face of terror.
Nearly 3000 people were killed after al-Qaeda operatives hijacked four planes. Two were flown into the World Trade Center's Twin Towers in New York, a third into the side of the Pentagon, while a fourth crashed into a Pennsylvania field, thought to be heading to the Capitol.
Those deadly attacks propelled US President George W. Bush to declare a War on Terror, and in the 20 years since, al-Qaeda has been ruthlessly hunted by the US and its partners.
The invasion of Afghanistan, where al-Qaeda based itself under the Taliban's protection, led to its leaders and fighters either being captured, killed or forced to cross the border into Pakistan. Al-Qaeda was thrown into disarray, but it didn't wither away, even after leader Osama bin Laden's death in 2011 at the hands of US Navy SEALs in Pakistan and despite every US President since Bush claiming victory.
Instead, while much of the Western world's attention turned to the threat of Islamic State (IS), there was growth in al-Qaeda affiliates around central Asia, the Middle East and Africa.
A United Nations report from June 2021 said al-Qaeda may have up to 500 fighters.
That, however, was before the fall of Afghanistan to the Taliban two months later, an event that analysts suggest could be a "reset" for terrorist groups in the region.
Taliban takeover - and what it means for al-Qaeda
In February 2020, the US reached a peace agreement with the Islamic fundamentalist Taliban in Doha, Qatar. The Taliban agreed to allow foreign forces to withdraw from Afghanistan, guaranteed terrorist groups - including al-Qaeda - wouldn't be permitted to operate there, and that it would talk with the Afghan government.
However, as the US withdrew in 2021, the Taliban went on the offensive, seizing provincial capitals and, in August, the nation's capital, Kabul. The speed of the Afghan army's collapse and the Taliban's takeover astonished world leaders, far quicker than intelligence had suggested.
Afghan President Ashraf Ghani fled the country and thousands of foreigners and citizens tried to do the same. Those who escaped, and many who remain stuck there, fear the Taliban will impose a strict rule as it did during its first period in power between 1996 and 2001, before it was deposed during the US-led invasion.
Despite the Taliban saying it will allow an inclusive society, there are already signs it will crackdown on dissent and those who violate its beliefs.
With the US now gone from Afghan soil and the Taliban back, there are concerns terrorist organisations may benefit as they did more than 20 years ago.
"The whole community is kind of watching to see what happens and whether or not al-Qaeda has the ability to regenerate in Afghanistan," Lloyd J. Austin III, the US Secretary of Defence, said on Thursday.
"The nature of al-Qaeda and ISIS-K is they will always attempt to find space to grow and regenerate, whether it's there, whether it's in Somalia or whether it's in any other ungoverned space. I think that's the nature of the organisation."
Geoffrey Miller, an international analyst with Victoria University's Democracy Project, quoted Mark Twain in saying that "history never repeats itself, but it rhymes".
He told Newshub the situation in Afghanistan currently isn't too different to 1989, when the Soviet Union ended its occupation, leaving the country's future in doubt with a lack of real leadership and a large number of rival factions. The Taliban eventually took charge and provided refuge to bin Laden and al-Qaeda.
"It's a real vacuum where anything could happen. You've got a whole lot of arms, a lot of US military supplies that were left behind and it does all feel very familiar," he said.
"I just think this withdrawal at the end of all this is just a reset, it's a reset button. Everything will change now because you just don't have the US factor there and you don't have the Afghan government there. So in a sense, it does become a bit of a free-for-all."
Alexander Gillespie, an international law professor at the University of Waikato, also sees parallels.
"When the Soviets left Afghanistan in 1989, part of the deal was that Afghanistan would not be used for extremism, but then the country collapsed," he said. "And then in that collapse, the Taliban rose and al-Qaeda kind of attached themselves like a virus to them.
"It's equally likely that even though you've got a similar promise with this peace deal with America, that they won't get stability, that terror groups will come back and then they will continue to do whatever mayhem they are aiming to achieve."
Al-Qaeda may evolve in Afghanistan or a new group may emerge, he said.
"These groups will grow in failed states no matter where they are because they are very difficult to suppress. I think it's quite possible that al-Qaeda or something like it will appear in Afghanistan in time to come."
In an interview with US thinktank The Wilson Center, Rita Katz, the founder of counterterrorism organisation SITE Intelligence Group, said the Taliban's takeover "is the biggest boost to al-Qaeda since 9/11".
"Al-Qaeda, its affiliates and supporters celebrated the Taliban's victory," she said. "There is universal recognition that al-Qaeda can now reinvest in its longstanding safe haven. Al-Qaeda supporters have stressed this message while writing off the Taliban's claims that it will not allow al-Qaeda to plot attacks against the United States from Afghan soil."
It's widely agreed by analysts that al-Qaeda will continue to focus on destabilisation efforts in the Middle East and Africa rather than attacks in the West, at least in the near future.
The UN's June report said it was "impossible to assess with confidence that the Taliban will live up to its commitment to suppress any future international threat emanating from Al-Qaeda in Afghanistan", with the two groups remaining "closely aligned and [showing] no indication of breaking ties".
Al-Qaeda, under both bin Laden and current leader Ayman al-Zawahiri, have pledged allegiance to the Taliban, an act referred to as 'bay'ah'.
Assessments suggest al-Qaeda's long-term plan is "strategic patience for a period of time before it would seek to plan attacks against international targets again". But this scenario "is untested against stated Taliban commitments to prohibit such activities".
Robert Patman, a professor of international relations at the University of Otago, told Newshub the Afghan regime change may lead to a resurgent al-Qaeda regardless of whether the Taliban support it.
"The Taliban coming to power is unsettling," he said. "The fact they come to power may embolden terrorist organisations like al-Qaeda independently of whether they have access [to Afghanistan], whether they are being backed by the Taliban or not."
He said terrorist groups will "be encouraged by the fact that the Americans have effectively left Afghanistan, where America first launched its first operation in the so-called War on Terror".
"I'm sure it will have some symbolic significance as far as they're concerned."
Miller said the Taliban may not want to support al-Qaeda as it has already seen the consequences of that.
"Al-Qaeda brought the Taliban down with them because of the US retaliation after 9/11 and the invasion of Afghanistan. It was the end of the Taliban's rule. So they waited 20 years to get back into power," he said.
"It's been a long, hard slog. They do have an incentive not to let al-Qaeda plan some big attack against the West. Then it sees history repeating once more."
But the Taliban of pre-2001 is very much still alive, with an interim government announced this week including a number of its old guard. That includes Sirajuddin Haqqani, the head of the Haqqani network who is wanted by the FBI. The Haqqani network has been described as the "military wing" of the Taliban and, according to the June UN report, is the primary liaison between the Taliban and al-Qaeda.
The Taliban will be looking for international legitimacy, Patman said - something they're unlikely to get if they're suspected of supporting al-Qaeda.
"I would not be surprised, particularly with the lineup of the Taliban government, whether they're really going to struggle to get international legitimacy and they could be presiding over a humanitarian disaster in the not too distant future in Afghanistan.
"Its economy depends on about 20 percent of foreign aid. So if it doesn't get that aid, then it's going to really struggle."
He said the Taliban's "got their work cut out" ruling a society that has changed significantly over the last 20 years, with a radical improvement to women's rights.
The rise of other threats
According to the June UN report, the number of foreign fighters in Afghanistan was estimated to be up to 10,000. But that has likely swelled since the fall of Kabul and the Taliban's return to power.
These fighters are aligned to a number of groups, including the Taliban, Al-Qaeda and IS.
Patman said IS was a "game-changer" for al-Qaeda over the last decade. He said they had "slightly different visions of their brand of fundamentalist Islam", but IS succeeded in establishing territory in parts of Syria and Iraq, at least until 2017.
"The other big difference was the sophistication of IS's social media operations," he said.
"Al-Qaeda tended to rely on, at least in its first 10 years of existence, videos and things like that. But Islamic State began to embrace the revolution that affected digital communications and they began to produce quite slick propaganda and recruiting programmes on the Internet and with the hope of recruiting so-called lone-wolf supporters."
Gillespie told Newshub the rise of IS was significant for al-Qaeda as they're "both competing for the same recruits".
"Islamic State mopped up a lot of those people who are sympathetic to extremism more effectively than al-Qaeda did outside of the region, outside of the Middle East. In the Middle East, [al-Qaeda] have still got partners and they are still active. But they lost appeal to the generation that they're trying to speak to."
While IS has declined in recent years, its Afghan affiliate group ISIS-K has made itself known recently. It was formed in 2015 from members of the Tehrik-i-Taliban Pakistan Islamic militant group and would later recruit militants from other terrorist organisations, including the Taliban.
Notably, it was responsible for the suicide attack on Kabul's airport as evacuations were underway in August and is an enemy of the Taliban.
Miller describes it as the one to watch.
"We may see Al-Qaeda resurge and regroup and become stronger again. [But] ISIS-K group has shown that it's able to conduct a big attack in a way that al-Qaeda used to," he said.
"Al-Qaeda, certainly it could go back to doing what it used to do - and that's planning attacks against Western targets. But they really haven't had the ability or the strength or perhaps also the will to do that anymore."
Patman also said the Taliban's rise to power may embolden groups in other countries.
"I think Pakistan is a country to watch because they've got a lot of militant Islamists in their country and they have their own Taliban who are closely linked to the Taliban in Afghanistan," he said. "Now, they may be tempted to assert themselves more in Pakistan now that their counterparts in Afghanistan have been so successful."
"This is a country which has got nuclear weapons. I think for many developed countries, the nightmare scenario has always been a terrorist organisation, whether it be al-Qaeda or any other groups such as Islamic State, getting access to nuclear capabilities."
For now, it's agreed Afghanistan reflects an unpredictable environment and its future - as well as that of the terrorists operating there - will depend in part on the Taliban's moves.
"Terrorism comes in waves - the last wave peaked in 2014/2015 - and then it will go down again," Gillespie said. "This kind of jihadi terrorism, it will come back, but, as each country gets better at dealing with terrorism, we learn from the mistakes."
"You will never be able to do another Twin Towers attack, but it means that they will focus more on other countries, not in the West. I think you're likely to see a rise in terrorism for these groups more around the Middle East than the Western countries, which get increasingly better at being able to deflect them.
"For Afghanistan, I think that they're going to have a very difficult challenge ahead, whether you accept the Taliban as ruling regime or not, and I know a lot of Western governments don't accept them.
"The more that they don't get accepted, the more attractive they will be to radical extremist groups."