The historic resolution seeking an advisory opinion from the International Court of Justice was inspired by Pacific island law students and passed with a consensus vote after a four-year campaign led by Vanuatu.
"Such an opinion would assist the General Assembly, the UN and Member States to take the bolder and stronger climate action that our world so desperately needs," UN Secretary General António Guterres said.
An advisory opinion would not be binding on any jurisdiction but could influence future negotiations.
Vanuatu Prime Minister Ishmael Kalsakau said it "will have a powerful and positive impact on how we address climate change and protect present and future generations."
"Together we will send a loud and clear message not only around the world but far into the future that on this very day, the people of the UN acting through their governments decided to leave aside differences and work together to tackle the defining challenge of our time," he said before the General Assembly.
Vanuatu pushed for the resolution, leading a core group of 18 countries ranging from Costa Rica to Germany.
Countries will submit input over the next year.
It could take the court about 18 months to issue an advisory opinion that could clarify financial obligations countries have on climate change, help them revise and enhance national climate plans submitted to the Paris Agreement and strengthen domestic policies and legislation.
Vanuatu and other vulnerable countries are already grappling with powerful effects of a heating planet.
The south Pacific island has been slammed by powerful climate-fuelled cyclones, including two this month that left 10 per cent of its population still in evacuation centres.
On the eve of the vote, Vanuatu diplomats were still trying to win support from China and the US, or at least convince the two biggest greenhouse gas emitting countries not to raise objections.
The United States did not support the resolution at the General Assembly.
"We believe that diplomacy - not an international judicial process - is the most effective path forward for advancing global efforts to tackle the climate crisis," a senior US official said.
"We have expressed that directly to our partners and made that clear at the UN."
The latest report by the Intergovernmental Panel on Climate Change warned that to limit global warming to 1.5C, greenhouse gas emissions must be nearly halved by 2030.
Bangladesh's foreign secretary called the resolution's passage a "defining moment" that can help bridge the gap between climate finance promises made to vulnerable countries and what is delivered.
"Despite better needs for financing, we see growing expenditure in military budgets or armaments of funding wars and conflicts or even bailing out companies during a financial crisis," he said.
"We hope this resolution and consequent advisory opinion will provide a better understanding of the legal implications of climate change under international law."
The resulting advisory opinion could be a vital input to the burgeoning climate-driven lawsuits around the world.
There are upwards of 2000 cases pending worldwide.
"A decision from the ICJ could be very influential with courts around the world that are faced with the growing number of climate change cases," Michael Gerrard, director of Columbia University's Sabin Center for Climate Change Law. said.