Image copyright AP Image caption The US has been lobbying hard for India to join the Nuclear Suppliers Group

India's American-backed bid to join the prestigious Nuclear Suppliers Group (NSG) has once again isolated Pakistan in South Asia.

Pakistan is increasingly finding itself friendless in the region as Iran, Afghanistan and India all find fault with Pakistan's inability to end terrorism on its soil and in particular to bring the Afghan Taliban to the table for peace talks, as Islamabad promised to do nearly two years ago.

The 48-nation NSG, which sets global rules for international trade in nuclear energy technology, has become the latest diplomatic battleground between India and Pakistan. It is due to hold a crucial meeting this month. The Pakistani military is angry that after Indian Prime Minister Narendra Modi's recent trip to Washington, the US has been furiously lobbying all member countries to give India a seat at the NSG table.

Pakistan then asked for the same, but its proliferation record is not as good as India's and it clearly would not succeed. Instead, it has asked China to veto the Indian bid which it is likely to do. However, smaller countries are angry with the US, who they accuse of browbeating them, and complain that neither India nor Pakistan can become members until they sign the nuclear non-proliferation treaty (NPT) which is an essential requirement.

President Obama backs Indian entry to nuclear technology

Pariah to friend: Narendra Modi and the US come full circle

President Obama is going against his own policy of nuclear restraint and disarmament by offering to make India - but not Pakistan - a member of the NSG, when the US has also tied up plans to sell India six nuclear power plants.

Image copyright Reuters Image caption India's economy is growing fast and it has plans to build many nuclear plants

At the same time the US has shown in several dramatic steps that it is deeply unsatisfied with Pakistan's efforts to stop the Afghan Taliban operating out of Pakistan. Last month it used a drone in Balochistan province to kill Mullah Akthar Mansour, the Taliban leader, which led to Pakistan accusing the US of violating its sovereignty.

The US then publicly accused Pakistan of not doing enough to stop the Taliban and the Haqqani militant group - and in a clear signal of support to the beleaguered Afghan government, President Obama has allowed remaining US forces in Afghanistan to fight alongside Afghan forces.

Finally, during Mr Modi's trip the US publicly condemned those extremist groups operating out of Pakistani Punjab and Kashmir whose activities Islamabad has not stopped. In what was seen as a clear snub and a signal of defiance to the US and India, the military allowed Hafiz Saeed, the leader of Lashkar-e-Taiba who is wanted for the Mumbai bombings in 2008, to lead prayers last Friday in Islamabad.

The military's fear is that it believes the US is withdrawing from South Asia and will leave behind its rival India as the regional policeman - something it cannot tolerate. The military has already accused Iran and Afghanistan of hosting Indian spies which are working to undermine Pakistan and in particular sabotage the One Road One Belt route and transportation network that China has promised to build from the Gulf port of Gwadar to China.

Pakistan's relations with Afghanistan are as bad as they have been for years, and not much better with Iran. After waiting for more than a year Afghan President Ashraf Ghani has now washed his hands of trying to persuade Pakistan to get the Taliban to hold talks with Kabul. His frustration has clearly been supported now by the Americans.

Image copyright Reuters Image caption The India Pakistan border in Kashmir remains heavily armed, years after independence from Britain

Image copyright AFP Image caption The Pakistani military is accused of giving continuing support to the Afghan Taliban leadership

Meanwhile, with sanctions against Iran having ended, civilian politicians and the public were looking forward to the quick building of an Iranian oil and gas pipeline that would give Pakistan desperately needed energy and electricity. However after Islamabad accused Iran of hosting Indians trying to sabotage Pakistan's economy, Iran is now nursing its pride.

China remains Pakistan's closest ally but China, too, is becoming frustrated. It plans to build a $45bn transportation and energy link up to its grand Silk Route project through Central Asia, but it wants the military to use its political influence to first end the Taliban-led war in Afghanistan and the insurgency in Balochistan province.

The chronic state of Pakistan's foreign policy has affected domestic politics. Part of the problem is that there is little input from the civilian government of Prime Minister Nawaz Sharif or the foreign ministry or parliament into making policy - that has become the domain of the military.

Mr Sharif has wanted to improve ties with India, Iran and the US but he has been unable to do so. Meanwhile, opposition politicians have accused Mr Sharif of surrendering all foreign policy decisions to the military.

The military in turn are deeply frustrated - and here they have considerable public support - that Mr Sharif has not appointed a foreign minister or improved governance. He has not even given up the portfolio for foreign affairs even as he recovers from open heart surgery in London.

The region is changing rapidly and Pakistan needs urgently to address its security and improve relations with its neighbours.

Ahmed Rashid