For the Americans, the most important part of Mr. Modi’s visit was his announced intention to formally join the Paris climate change agreement by the end of this year. So far, countries representing about 50 percent of global emissions have announced that they will submit legal paperwork to the United Nations documenting their compliance with the deal.

The pact will become binding when at least 55 countries representing 55 percent of global emissions formally join. The inclusion of India, the world’s third-largest emitter after China and the United States, would guarantee that the deal will go into effect before the next American president takes office.

Mr. Trump has vowed to “cancel” the Paris climate agreement if elected, something Mr. Obama is eager to prevent. Once the accord enters into legal force, no nation can legally withdraw for four years.

“If the Paris agreement achieves ratification before Inauguration Day, it would be impossible for the Trump administration to renegotiate or even drop out during the first presidential term,” said Robert N. Stavins, the director of the environmental economics program at Harvard.

Mr. Obama and Mr. Modi also announced a separate agreement to cut the use of hydrofluorocarbons, potent planet-warming chemicals produced by coolants in refrigerators and air-conditioners. India and the United States have been at odds on the details of such a deal, but the agreement announced on Tuesday means both governments now expect in October to sign on to an international accord to phase out the chemicals. Phasing out the chemicals could reduce by 25 percent the expected warming of the planet by the end of the century.

“This is the most significant step the international community could take” to reduce climate warming, Brian Deese, a senior adviser to Mr. Obama, said in a call with reporters.

The two sides also announced joint efforts for the United States to invest in India’s renewable energy development, including the creation of a $20 million finance initiative.