When the Taliban captured Kabul, Pakistan PM Imran Khan said Afghans had broken "shackles of slavery".
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 take 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 terrorist group as it battled the US-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 hold 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 that 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, which has been locked in a military standoff with China for more than a year.
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) terrorists, 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 US government says ETIM no longer exists as a formal organisation 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
Raza Ahmad Rumi, a political commentator, who teaches at Ithaca College in New York, said, "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."
India has bitter memories of the previous Taliban stint in power from 1996 to 2001 and the terror group's links to Pakistan.
An Indian Airlines plane was hijacked in 1999 and landed in Kandahar in southern Afghanistan. New Delhi had to free three Pakistani terrorists 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 US-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.
'NOT A RE-RUN'
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, "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."