French President Francois Hollande was the first leader to put his signature to the accord, and was quickly followed by leaders from island-states hardest hit by climate change.
US Secretary of State John Kerry came to the podium cradling one of his granddaughters in his arms and triggered warm applause from delegates as he signed the historic deal.
It was the largest ever one-day signing of an international agreement, marking a first step toward binding countries to the promises they made to cut greenhouse gas emissions.
"This is a moment in history," UN Secretary-General Ban Ki-moon said after announcing that 171 countries were set to sign the accord.
"Today you are signing a new covenant with the future," he said.
Held on Earth Day, the ceremony comes 4 months after the hard-won deal was clinched in Paris after years of tough bargaining.
"Some may say it's only a small step. We need to make it a huge one," said the prime minister of the Polynesian island of Tuvalu, Enele Sosene Sopoaga.
Together the signatories account for 93 percent of global greenhouse gas, according to calculations by World Resource Institute.
Hollande called on governments to quickly ratify the Paris deal and singled out the European Union, saying the 28-nation bloc should "lead by example" and give final approval before the end of the year.
The Paris agreement will come into force as soon as 55 countries responsible for 55 percent of the world's greenhouse gases have ratified it.
The target date for the agreement to begin is 2020, but momentum is building to ensure the accord enters into force much earlier.
Actor and environmental campaigner Leonardo DiCaprio urged leaders to move quickly, telling them: "The world is now watching".
"You will either be lauded by future generations or be vilified by them," he said.
China and the United States have said they will ratify this year and are pushing for others to follow suit so that the agreement becomes operational possibly as early as late 2016 or 2017.
But the European Union may take up to a year and half for the ratification.
A race against time
Caught in election-year turmoil, the United States plans to ratify the Paris accord with an executive agreement, bypassing the Senate and setting up a complex process for any future president wishing to pull out.
Moving quickly, 15 countries, mostly island states, have already fully approved the agreement and will formally present the completed ratification to the United Nations.
"We are in a race against time," Ban told the gathering at the UN General Assembly.
Last month was the hottest March in modern history and 2016 is shaping up as a record-breaking year for rising global temperatures.
This year's El Niño – dubbed "Darth Niño" – is wreaking havoc, with droughts, floods, severe storms and other extreme weather patterns.
Agreed by 195 nations, the Paris deal sets the goal of limiting global warming to two degrees Celsius above pre-industrial levels by moving to clean energy.
Ban stressed that the window for keeping the global temperature rise below two degrees Celsius was rapidly closing.
The Paris deal also places an onus on rich nations to help poorer ones make the transition to a low-carbon economy.
The agreement was seen as a triumph for Ban, who pushed for the deal throughout his tenure and has listed the agreement in Paris as one of his proudest moments as UN chief. – Carole Landry, Agence France-Presse / Rappler.com