Speaking Freely is an Asia Times Online feature that allows guest writers to have their say. Please click hereif you are interested in contributing.

China may be the key factor that India needs to balance what bill become an increasingly difficult Afghan equation after the planned US exit in 2014.

Pakistan is the common denominator for both China and India in the emerging geopolitical calculus and Beijing has vast influence

over Islamabad as its acknowledged "all-weather ally".

To salvage its massive investments in Afghanistan, New Delhi's main hope, apart from putting a large number of its own troops on ground, is coaxing Beijing to use its considerable clout with Islamabad.

Islamabad's military intelligence controls major Taliban elements, which are housed along its border and continue to launch targeted attacks inside Afghanistan.

Both China and India have a huge stake in an Afghanistan dispensation in which extremist Taliban elements do not wield undue influence.

New Delhi has reasons to worry about a nightmarish security scenario that could emerge after US-led coalition forces leave war-ravaged Afghanistan – a country they occupied following the September 11, 2001 al-Qaeda attacks on US soil, planned and executed by Osama bin Laden, who was living under the protection of Afghanistan's then Taliban regime. Taliban elements have been tormenting Indian interests with targeted bomb blasts despite the US security cover.

Though India and Afghanistan do not share a border, New Delhi has pledged about $2 billion aid for funding the development of transportation infrastructure and health care facilities in the country of 30 million people since 2006.

The value of Indian commercial investments in Afghanistan, including in hydro-power projects and mining, amount to more than $10 billion. New Delhi sees Afghanistan as a strategic gateway towards resource-rich Central Asia that avoids having to go through Pakistan.

India does have a strategic treaty with Afghanistan though New Delhi has not sent over military personnel, a move seen as deferring to US sentiments over Pakistani sensibilities.

India, which has close ties with President Hamid Karzai, has built several major roads in his country. One of them is the country's transportation lifeline, linking capital Kabul in the north with Iranian border in the south. New Delhi has also pledged $100 million to develop the Chabahar port with Iran, giving the land-locked Afghanistan an alternative to Karachi in Pakistan to access the Arabian Sea.

Although Chinese aid for Afghanistan is only an estimated $200 million, it has acquired huge financial stakes in oil and mining industries in Afghanistan. It's commitments to develop the Aynak copper mines in Logar province south of Kabul is estimated to be worth $3 billion. Though China is in no hurry after securing a 30-year lease in the project, it has to safeguard its long-term stake after investing about $800 million.

Chinese state companies also have acquired concessions in Amu Darya basin in northern Afghanistan's Frayab province for oil explorations. They have put down an initial investment of $400 million.

Afghanistan, which shares a porous border with Pakistan, has an uneasy relationship with that country. President Karzai's occasional outbursts accusing Pakistani military intelligence of aiding Taliban bombings in his country have not helped matters.

For India, a return to power in Kabul by Taliban, which already controls much of southern Afghanistan, will have more implications than a mere loss of investments.

Another security nightmare for New Delhi is that an extremist Taliban government in Kabul supported by the Pakistani military foments more trouble in its part of Kashmir, which Pakistan considers a disputed territory. India and Pakistan control parts of Kashmir straddling a ceasefire line - which is called the Line of Control - but both claim the territory in whole. The two countries fought two wars in 1947 and 1965 and were embroiled in a border skirmish in 1999, a year after the two countries went nuclear ringing alarm bells in the West.

Though, under US prodding, Karzai agreed to talk to Taliban to hammer out a post-US arrangement in Kabul, the negotiations planned in Qatar never got off the ground. An enraged Karzai called off the talks after Taliban wanted to use the flag of the Islamic Emirate of Afghanistan, the name they preferred to use during their rule in Kabul.

Some recent incidents have encouraged Indian optimism of finding a more receptive China to its plans for Afghanistan.

One is an Islamist terror attack on a hotel in Gilgit-Baltistan of Pakistan-controlled Kashmir. On June 23 early morning, about a dozen gunmen walked into a hotel in a mountaineering base camp near the Nanga Parbat peak and gunned down nine tourists and their tourist guide. Of the victims two were Chinese citizens and one a Chinese origin person from the US. The others were Ukrainians.

A shocked Beijing has strongly condemned the attacks and Islamabad has vowed to hunt down the guilty. A unit of what has come to be know as Pakistani Taliban has claimed responsibility for the attack. China will not be amused by the fact that the new Nawaz Sharif government in Islamabad has announced plans to talk to this outfit.

Gilgit-Baltistan borders China's troubled Xinjiang province where ethnic Uyghur Muslims clashed with police twice in three days resulting in scores of deaths. Though government sources claimed there were 35 deaths, some reports say the fatalities may be more than 50.

During his recent visit to Pakistan, Premier Li had signed new agreements for Chinese aid for more infrastructure projects in Gilgit-Baltistan. China has also signed an agreement to station more Peoples Liberation Army troops in Pakistani area of Kashmir to improve security.

Gilgit-Baltistan is connected through the Karakoram highway to Xinjiang and China is wary about extremists elements from Pakistan's mountainous western border with Afghanistan fomenting more trouble.

Once an extremist Taliban government is established in Kabul, there will be little an already strained Pakistan could do to stop their further infiltration into Xinjiang.

An Indian team led by national security adviser Shivshankar Menon is now in Beijing for the 16th India-China border talks. Some Indian sources indicated that apart from the thorny border issues between the two countries, they might exchange views on the emerging geopolitical situation in the immediate neighborhood of the two countries.

Afghanistan is believed to have figured in talks when Premier Li Keqiang visited India towards the end of May, though the talks mainly centered on the prickly border disputes.

Indian analysts believe it is not only the fear of tentacles of terror reaching across the Himalayas into its own territory that China might be inclined to play ball with India in Afghanistan. China has obtained 30-year leases for copper mining in extensive areas, making it one of the top investors in the impoverished country. It is a fact that Taliban's rise to power will bring clouds of uncertainty over these investments.

Moreover an Islamist government could try to arm twist Beijing into taking a softer stand on trouble makers in Xinjiang or even send its own foot soldiers into Chinese areas to create trouble.

That is why China would be compelled to bring in Pakistan into the equation. Beijing has enormous leverage with Islamabad, being its largest defense partner.

Prime Minister Nawaz Sharif will be visiting Beijing next month in a bid to warm up ties. The talks are sure to include the future of Afghanistan, apart from various Chinese investments in Pakistan. Beijing has reasons to stress on the importance of improving the security environment in Pakistan.

When US planes bombed Afghanistan in 2002 after the Taliban regime refused to hand over Bin Laden, the Taliban leadership fled to the border region with Pakistan. Though Islamabad was ostensibly a US ally in war on terror, US intelligence sources have said elements in Pakistan's military intelligence helped and protected Taliban leadership. What they were saying in private became public when US Navy seals shot dead Bin Laden in a house in an army town close to Islamabad. It is also suspected that Taliban leader Mullah Omar had his safe haven in the Pakistani province of Balochistan at least for some time from where he directed attacks inside Afghanistan.

Indian analysts hope that China would be able to use its leverage with Pakistan in suggesting to the Taliban leadership not to disturb overseas investments even if they come to power in Afghanistan. However, it might be optimistic to think it will be easy for Pakistan to agree to such an arrangement, considering its security concerns about a strong Indian presence in Afghanistan.

That is why the equation will remain a difficult one to balance for India, even with the China factor.

Speaking Freely is an Asia Times Online feature that allows guest writers to have their say.Please click hereif you are interested in contributing. Articles submitted for this section allow our readers to express their opinions and do not necessarily meet the same editorial standards of Asia Times Online's regular contributors.

Prathapan Bhaskaran is a freelance journalist based in India writing on South Asia affairs.