Mr. Obama’s visit, his second as president, is a major event in India. Despite lingering distrust over Washington’s history of support for rival Pakistan, the United States enjoys widespread popularity here. For weeks, the Hindi news media has dissected details of Mr. Obama’s visit, running half-page graphics of his limousine and airplane, broadcasting a detailed report about his BlackBerry and advising Michelle Obama on couture saris to wear.

Mr. Obama’s visit was marred by his decision to cut it short by several hours and skip a tour of the Taj Mahal on Tuesday to fly to Saudi Arabia to pay respects to the family of King Abdullah, who died on Friday. But that was quickly set aside as Mr. Obama was welcomed with a red carpet, an honor guard and a 21-gun salute. He threw flowers on the memorial to Mahatma Gandhi at Rajghat. He and Mr. Modi took a walk through a garden and shared tea. And Mr. Obama was announced by trumpets at the state dinner.

Mr. Modi’s reference to Mr. Obama by his first name drew notice. “It’s never been done before in India, to my knowledge,” said Baijayant Panda, an Indian lawmaker. “This is clearly sending signals to a lot of people, a lot of heads of government that matter.”

Still, the spectacle outweighed the substance in most cases. On climate change, India agreed to move to phase down hydrofluorocarbons, or HFCs, according to a treaty known as the Montreal Protocol. But more broadly, India set no specific goals limiting greenhouse gases, as Beijing did in November. India is the third-largest carbon polluter behind the United States and China but has resisted bolder measures, citing its need to lift hundreds of millions out of poverty.

Image Mr. Obama and Michelle Obama greeting guests before dinner ceremonies hosted by President Pranab Mukherjee, left. Credit... Stephen Crowley/The New York Times

Instead, the two sides agreed to promote solar, wind and other clean energy, and Mr. Modi said he would support a global climate pact to be shaped in Paris this year. Mr. Modi said he felt no pressure to match China’s commitment. “Climate change itself is a huge pressure,” he said. “Global warming is a huge pressure.”

The nuclear understanding may finally bring to fruition an agreement that President George W. Bush reached with India in 2006 to end a moratorium on sales of nuclear fuel and reactor components to India, stemming from its first nuclear test in 1974. The promise of a thriving new nuclear trade never materialized because of a 2010 Indian law that would hold American companies liable for accidents in a way that they said went beyond an international convention, a delicate issue in a country still scarred by the Bhopal chemical disaster 30 years ago.