Afghanistan’s newly discovered mineral wealth — worth perhaps as much as a trillion dollars or more — offers the country a chance for a better future. But it will also intensify the struggle from its neighbors and the big powers to control Afghanistan’s politics and destiny. For America’s longest war, the stakes have gotten bigger.

The Soviet invaders of Afghanistan did the first serious geological surveys of the country in the 1980s. But when Moscow decided to give up the fight against the mujahedin in 1989, the results were hidden away in the safes of Afghanistan’s communist government. It took the United States three years to find the survey data after 2001 and then another couple of years to start checking it out. Earlier this year the government of President Hamid Karzai was presented with the good news: you are sitting on a mountain of wealth.

Afghanistan’s mineral wealth includes iron, copper, cobalt, gold and critical industrial metals like lithium. Iron and copper are probably the biggest windfalls. Afghanistan’s former Finance Minister Ashraf Ghani told me a month ago that the prospects are dazzling for his country. Afghanistan was a desperately poor country 30 years ago before the Soviets invaded. Since then it has been wracked by civil war, terror, anarchy and foreign interference. The economy has been captured by the opium trade. So the mineral wealth offers a chance for Afghanistan to build a better future.

That will of course require massive foreign investment to create a mining industry which does not exist. And that will mean competition between the potential investors and competition to find ways to export the minerals out of land locked Afghanistan. At the top of the list will be the two fast growing mega-economies of Asia, China and India.

China has already won a $3 billion bid for a copper mine south of Kabul. China has a voracious appetite for minerals to fuel its economy. China and Afghanistan share a short border with Afghanistan at the tip of the Wakhan corridor—a geographic oddity left over from the British Empire—at the Wajir pass, but no road connects them and the pass is closed by snow half the year.

India’s economy is also growing faster than ever. It has been a major investor in Afghanistan since the fall of the Taliban. It has provided or pledged over a billion dollars in aid to the Karzai government. New Delhi has built a major road project in south western Afghanistan that links the Afghan ring road to Iran, thus creating a land line to the Arabian Sea that bypasses Pakistan, so that Afghanistan has an export route independent of Islamabad. India provided its own troops to protect the highway construction. This has put India and Iran together in competition with Pakistan.

Every Indian activity in Afghanistan provokes acute concern in Islamabad. The road project via Iran pushed every Pakistani button. Pakistan has the most complex relationship of all with Afghanistan. Their border, the so-called Durand line, is also a vestige of British imperialism. No Afghan government has ever accepted it, not even the Pakistani backed Taliban government. Pakistan is determined to be a major player in Afghan politics and the sight of its rival investing in Afghan minerals will encourage every Pakistani fear and conspiracy theory about Indian and others intentions. Today Pakistan’s mega city of Karachi is the key port for importing and exporting into Afghanistan; for example, more than three quarters of NATO’s supplies come via Karachi. Pakistan will want to exploit its lock on Afghan transit routes to enrich its own economy. It will look to work with its traditional ally, China, against India.

Other big economies, including the United States, Russia, Europe and Japan, will doubtless also want to get a share of the action. Russia and the Central Asian states will now have a much bigger incentive to develop alternative trade routes to the north from Afghanistan. Those routes face formidable geography and very long distances to ports.

In theory, all of the competition should be good for Afghanistan and bring in the best. In practice, given the rampant corruption in the country, it could bring out the worst. There are already allegations of bribery in the China copper deal.

The “great game” was the British nickname for the competition between the British and the Russians for dominance in Afghanistan in the 19th Century. Afghanistan has been a victim of this game for over two centuries now. Minerals will make the game all the more attractive. Building security in the country will face even more hurdles with more competition by outsiders for influence and mining rights. Obama’s war just got even more important and complicated.