NEW DELHI — When President Obama landed here for a three-day visit, he brought a long list of issues to discuss, like energy and trade. But when he and Prime Minister Narendra Modi of India sat down to talk, the first 45 minutes were dominated by just one: China.

Mr. Obama and his aides discovered to their surprise that Mr. Modi’s assessment of China’s rise and its impact on the greater strategic situation in East Asia was closely aligned with their own. Just as they did, Mr. Modi seemed increasingly uneasy about China’s efforts to extend its influence around the region and interested in a united approach to counter them.

He agreed to sign a joint statement with Mr. Obama chiding Beijing for provoking conflict with neighbors over control of the South China Sea. He suggested reviving a loose security network involving the United States, India, Japan and Australia. And he expressed interest in playing a greater role in the Asia-Pacific Economic Cooperation forum, where India could help balance China’s influence.

For years, American presidents have tried to enlist India, the world’s largest democracy, in a more robust partnership, partly to offset China’s rising power. India has had a long history of suspicion and rivalry with China, which allied with New Delhi’s archenemy Pakistan during the Cold War. But it has long insisted on being an independent actor in world affairs and resisted aligning itself with the United States against its giant neighbor.