NEW DELHI — Ranjan Mathai, the Indian foreign secretary, made the rounds in Washington last week, describing India’s relationship with the United States as one of growing comfort, depth and candor, if not perfect harmony. On that last point he could have been talking about the recent frictions between the two countries over Iran.

India’s determination to continue buying Iranian oil, despite sanctions and growing political pressure from the United States and Europe, has frustrated officials in Washington at a time when the forward momentum in the United States-India relationship has slowed, with differences over issues including civil nuclear cooperation, trade protectionism and military sales.

The situation was exacerbated last week by news reports that India had become Iran’s top oil customer, while an Indian official announced plans to send a trade delegation to Tehran. In New Delhi, diplomats and analysts say India’s purchasing of Iranian oil is a matter of economic necessity, given its dependence on imported oil. Some say the purchases also represent diplomatic hedging in a region bracing for the withdrawal of American troops from Afghanistan by 2014, or possibly sooner.

Indeed, many Indian officials, even those supportive of a stronger partnership with the United States, caution against turning issues like Iran into diplomatic litmus tests, considering the complexities of a neighborhood in which India represents a bulwark of stability, democracy and economic opportunity compared with Pakistan, Afghanistan and other countries.