NEW DELHI  Three decades and two oceans stand between President Obama and Prime Minister Manmohan Singh of India. But on a dais here after a joint news conference on Monday, the two men, neither known for their social ebullience, were inseparable: the youthful, lanky American president’s arm firmly fixed on the older man’s shoulder, Mr. Singh grinning widely with his arm wrapped tightly around Mr. Obama’s waist.

More than once during his three-day visit Mr. Obama called the relationship between India and the United States “the defining partnership of the 21st century.” But the relationship between the two men has evolved into something of a friendship as well. Mr. Obama has called Mr. Singh his guru, and on Monday Mr. Singh called Mr. Obama “a personal friend and a charismatic leader who has made a deep imprint on world affairs.”

The long and complicated relationship between the United States and India has veered from warm embrace long before independence to the uneasy frostbite of the cold war to the reconciliation of recent years, built on shared democratic and multicultural values and a desire to balance the influence of a rising China.

But even as broad historical forces have shaped the relationship, a personal bond appears to be forming between the leaders of the world’s two largest democracies, who developed an easy rapport in their numerous international meetings and have now given state dinners for each other on reciprocal visits.