In New Delhi there are gripes about the price of American friendship. Just a few months ago, the Bush administration had promised "full civil nuclear energy co-operation" with India, even though the country had nuclear weapons and persistently refused to sign the nuclear non-proliferation treaty.

There was talk of an emerging strategic partnership between America and India, and a quietly spoken long-term view to contain China. But despite all the warm words, little has happened. The reason is Iran.

In 2003, Delhi and Tehran signed a strategic pact, sealed by military and energy deals worth $20bn (£11bn). A few months later the two countries' navies held their first-ever joint exercises. Delhi is helping to build highways and a large port on the Persian Gulf - so that Indian goods can gain access to Central Asian markets. The Iranian route would bypass turbulent Afghanistan and Pakistan.

For India, Iran is one of its recent foreign policy successes. The two were on opposite sides during the cold war, and later diplomacy was compromised by Iran's fraternal ties with Pakistan. In January 2003, a few months before the Iraq war began, Iran's then president, Mohammed Khatami, was guest of honour at India's Republic Day parade - a spot reserved only for close allies.

From Iran's perspective, India is a big business opportunity. Not only will its insatiable appetite for hydrocarbons grow, but the Indian economy could yield important trade deals. Perhaps most important is that India's defence industry is largely impervious to American sanctions - providing Iran with a nearby pool of expertise and spare parts.

In reaching out to each other, Teheran and Delhi are looking to put the past behind them and recast their relationship. But such bonhomie does not suit America, which sees Iran as part of the global "axis of evil".

It was not always thus. In fact the United States built Iran's first nuclear plant at Amirabad, and knew that the Shah began a low-grade weapons research programme in 1967.

History aside, Washington has already made clear its deep reservations about India's good relations with Iran. On Capitol Hill, politicians have been fuming at comments made by an Indian foreign delegation to Iran this month about expanding ties and withstanding foreign (read American) pressure.

One congressman said that what the Indians were doing was "simply dense". The nuclear cooperation deal proposed by George Bush two months ago would not "fly", according to the disgruntled legislators, because the Indians were "incapable of comprehending that other countries have their important concerns".

The White House is pushing to bring sanctions against Iran for a suspected "nuclear weapons programme" and has only been stopped by a coalition of China, Russia and India. All three have good reasons to maintain friendly relations with Iran: China, even more than India, needs oil; Russia is a key partner in Iran's nuclear programme, and Delhi has fingers in both pies.

In South Asia, much more is at stake. A $4bn planned pipeline sending Iranian gas through Pakistan to India is under threat. Not only would the scheme mean greater energy security for India and Pakistan, but it would give Islamabad, Delhi and Tehran stakes in regional stability. In a rare show of unity, India and Pakistan appear ready to join hands and take on Washington over this project.

At the moment, the key battleground is at the International Atomic Energy Agency, where the Bush administration has faced concerted opposition to its proposal to refer Iran's civilian nuclear programme to the UN security council.

The reason for the flurry of attention is Iran's intention, made clear by the newly elected president, Mahmoud Ahmadinejad, to produce nuclear power using homemade enriched uranium. It's the indigenous production that worries the White House. What's to stop Iran from acquiring bomb-grade uranium 235 and going nuclear, wonders a White House haunted by the sights and sounds of the Iranian revolution?

Maybe an honourable way out for Washington and Tehran could be modelled on the deal offered to North Korea at the end of six-nation talks in Beijing this week. In it, Pyongyang initially agreed to abandon all nuclear weapons programmes and rejoin the nuclear non-proliferation treaty. In return, North Korea was offered electricity and an assurance that the US "has no intention to attack or invade [North Korea] with nuclear or conventional weapons".

For India, the way out appears to be sheltering in the commitments that Iran has made under the non-proliferation treaty. This is bizarre, as India has never signed this document itself, calling it "nuclear apartheid". Ominously, Iran's president used the same phrase at the United Nations.

India, and Pakistan both covertly produced weapons-grade uranium, designed weapons and got hold of missiles to launch them. Iran on the other hand has done none of this. But Tehran, depending on your viewpoint, has either been a rogue state or spent 20 years standing up to the Americans.

Although Washington is talking tough, the debacle in Iraq and the Katrina-effect on the domestic polls may mean it has no stomach for a bloody fight with Iran. Perhaps a better bet would be for America to encourage the stabilising aspects of any Indo-Iranian deals while still looking to prevent nuclear proliferation in the region.

That would mean Washington switching positions on the Indo-Pakistani pipeline. It would mean the US recognising that Iran plays a crucial role in securing Afghanistan's future and that an Indo-Pakistan-Iran grouping could be a gateway to developing Central Asia.

Unfortunately it is unlikely President Bush will see things this way. The next few months are going to be difficult days for New Delhi.