The world's top court will for the first time advise on countries' legal obligations to fight climate change, following a UN resolution.
The International Court of Justice will now prepare an advisory opinion that could be cited in climate court cases.
The motion came from Vanuatu, a low-lying Pacific island nation facing peril from rising sea levels.
Vanuatu's Prime Minister Ishmael Kalsakau called it "a win for climate justice of epic proportions".
The motion, sponsored by more than 130 countries, was greeted with cheers.
The idea for the legal opinion was originally proposed by law students in Fiji four years ago.
It was then taken up by Vanuatu, a country with bitter experience of the impacts of rising temperatures.
Earlier this year it , at an estimated cost in damages of roughly half the country's annual GDP.
These experiences gave added weight to Vanuatu's UN resolution, seeking legal clarity on responsibilities for climate change.
The country emphasised that it is not seeking the court's opinion to put in place new restrictions but to clarify existing obligations to prevent harm to the environment.
The resolution gained support from many countries because it was carefully crafted to avoid blaming the countries like the US and China that have contributed most to the warming gases that are driving up temperatures.
Experts say that while the ICJ's legal view would be non-binding, it could then be cited in climate court cases around the world.
"Vanuatu sees today's historic resolution as the beginning of a new era in multilateral climate co-operation, one that is more fully focused on upholding the rule of international law and an era that places human rights and intergenerational equity at the forefront of climate decision-making," said Ishmael Kalsakau, Prime Minister of Vanuatu, in a video statement to the UN.
The ICJ, based in the Netherlands, will now have two years to consider its view.
Lawyers supporting the case believe this process is necessary as right now, under the Paris climate agreement, there is confusion about a country's legal responsibilities regarding the causes of global warming.
"If you ask, in good faith, 10 international environmental lawyers whether what's happening with emissions in many states is unlawful under the Paris agreement, you will have an honest divide," said Jorge Viñuales, professor of law and environmental policy at Cambridge University, who's drafted the legal question to go in front of the court.
"Under international law, that can't make sense. So instead of looking at the Paris Agreement, you zoom out, and you look at the entirety of international law.
"It cannot be possible that destroying the planet is legal."
Supporters believe an ICJ decision would likely have a galvanising effect around the world on climate action.
Governments may learn that not curbing warming gases breaks international law. Courts in countries around the world may take their lead from the decision, and it may shape UN negotiations on climate change, and impact decisions by fossil fuel companies on their long-term investments.
"I think it's going to shape the discourse; it could be a game changer for new policies and for tightening existing policies," said Prof Viñuales.
"It may empower and embolden civil society to do more, and it may create a new political narrative that can be used in elections, for example."
For some of the law students at the Fiji campus of the University of the South Pacific, the idea of getting the world's top court to rule on climate change initially seemed too ambitious.
"Let's get real here," said Cynthia Houniuhi, a law student and president of a group calling itself Pacific Island Students Fighting Climate Change.
"How can a small group of students from the Pacific convince the majority of the UN members to support this initiative?"
Cynthia Houniuhi was one of the students who initiated the legal approach on climate change
But the group of 27 were ultimately persuaded by the very obvious signs of climate change all around them.
The students drafted a letter to Pacific island leaders which brought a positive response from Vanuatu.
They also contacted Prof Jorge Viñuales. His advice was to go for the top, and aim for the International Court of Justice.
"This is climate change. You don't go through the backdoor," he told BBC News.
Previous efforts to go down this route failed through lack of support, but the growing impacts of rising temperatures have changed minds and votes at the UN.
"This was an opportunity to do something bigger than ourselves, bigger than our fears, something important for our future," Houniuhi said, welcoming the move.
-BBC