The Russian and British empires battled over Afghanistan in the 19th century, and the United States and the Soviet Union in the 20th. As the Taliban takes over in the strategic, landlocked nation, the new Great Game has Pakistan in control, with its ally China looking to cement its grip on the region.
Pakistan has deep ties with the Taliban and has been accused of supporting the Islamist group as it battled the U.S.-backed government in Kabul - charges denied by Islamabad. When the Taliban captured Kabul last week, Pakistan Prime Minister Imran Khan said Afghans had broken the "shackles of slavery".
As the Taliban holds discussions to decide on its government model, media reports have said some Pakistani officials are involved.
A Foreign Office spokesperson in Islamabad said Pakistan wanted an inclusive political settlement in Afghanistan that ensured peace and stability in the region but added the "key role remains with the Afghans".
China, with no previous involvement in Afghanistan but a strong alliance with Pakistan, has held out an olive branch to the Taliban, enticed by the country's mineral wealth, including its large reserves of lithium, a key component for electric vehicles. China is also looking at the prospect of extra security for its narrow land route through the Karakoram mountains into Pakistan.
And then there is India - Pakistan's old enemy, which has been locked in a military standoff with China along their disputed border for more than a year. India was a key supporter of the ousted regime in Kabul and as both Pakistan and China become key players in a Taliban-ruled Afghanistan, New Delhi's nervousness in increasing.
China however says its main aim in reaching out to the Taliban is to protect its western Xinjiang region from anti-Beijing East Turkestan Islamic Movement (ETIM) militants, who could seek sanctuary within Afghanistan.
"While Pakistan might be thinking of leveraging on Afghanistan against India, this is not necessarily the case for China," said Zhang Li, a professor of South Asian studies at Sichuan University.
"China's primary concern now is for the Taliban to ... build an inclusive and moderate regime so that terrorism would not spill over to Xinjiang and the region. Any other calculus further to that remains to be seen."
The U.S. government says ETIM no longer exists as a formal organization and is instead a broad label China uses to oppress a variety of Muslim ethnic groups, including Uyghurs, in its Xinjiang region. China denies all accusations of abuse.
China has dangled the prospect of providing the two things the Taliban needs to govern Afghanistan: diplomatic recognition and much-needed infrastructure and economic assistance, said Brahma Chellaney, professor of strategic studies at the Centre for Policy Research in New Delhi.
"An opportunistic China is certain to exploit the new opening to make strategic inroads into mineral-rich Afghanistan and deepen its penetration of Pakistan, Iran, and Central Asia," he said.
Bitter memories
There was much cheering in Pakistan over India's discomfiture at the turn of events, said Raza Ahmad Rumi, a political commentator, who teaches at Ithaca College in New York. The two countries have fought three wars since they became independent nations when the subcontinent was divided in 1947.
"The jubilation in Pakistan witnessed on social media and TV screens was largely linked to the undoing of Indian influence as conventional policy circles viewed (Afghan President Ashraf) Ghani's close links with India as a threat," Rumi said.
India has bitter memories of the previous Taliban stint in power from 1996 to 2001 and the group's links to Pakistan.
An Indian Airlines plane was hijacked in 1999 and ultimately landed in Kandahar in southern Afghanistan. New Delhi freed three senior Pakistani militants in its jails in exchange for the return of the passengers and the Taliban allowed the hijackers and the released prisoners to go to Pakistan.
"Our position today is one of adjusting to reality. We have to play the long game in Afghanistan. We don't have a contiguous border but we have stakes there," said Jayant Prasad, a former Indian ambassador to Kabul.
Over the past year as the Taliban emerged as a dominant force and U.S.-brokered negotiations began in Doha, Indian diplomats had opened a line with the group, diplomatic sources in New Delhi said.
"We are talking to all stakeholders," one of them said, but did not want to get to the specifics of the discussions. There has been criticism at home that India put all its eggs in the basket of the Ghani government when the United States itself had begun talks with the Taliban, and that New Delhi left it too late.
'Not a re-run'
Still, India as a major economic player can be attractive to the Taliban, looking to avoid an over-dependence on China, the source said.
India has development projects in every one of Afghanistan's 34 provinces, small and big, including the parliament building in Kabul that it built, which was over-run by gun-toting Taliban men after sweeping into the city last week.
Myra MacDonald, author of three books on South Asia and a former Reuters journalist, said while the Taliban takeover was a setback for India, it was not game over for New Delhi.
"This is not a re-run of the past. Everyone is going to be much more careful this time about letting Islamist terrorism in Afghanistan explode as in the pre-9/11 days."
"Plus in relative terms, India is much more economically stronger than Pakistan this time around."
A senior member of the Taliban has told Reuters that impoverished Afghanistan needs help from countries in the region, including Iran, as well as the United States and Russia.
"We expect them to help us, to support our people, especially the health sector and especially the business sector and mining sector," said Waheedullah Hashimi, who has access to the group's decision-making.
"Our job is to convince them to accept us."