The world will be in deep trouble if it fails to tackle climate change and inequality, IMF managing director Christine Lagarde has warned.

"If we don't address these issues... we will be moving to a dark future" in 50 years, she told a major economic conference in the Saudi Arabia capital of Riyadh.

On climate change, Ms Lagarde said that "we will be toasted, roasted and grilled" if the world fails to take "critical decisions" on that problem.

In 2015, around 195 nations signed the Paris climate agreement which set out goals to reduce greenhouse gas emissions, so as to prevent temperatures rising by more than two degrees in around 50 years.

However, US President Donald Trump announced last June the start of a three-year process to pull out of the pact, arguing that it would put the US at an economic disadvantage.

Ms Lagarde also called for tackling inequality between men and women and countries that are "haves" and those that are "have nots".

If the world wants a future that "looks like utopia and not dystopia", it needs to address such concerns, Ms Lagarde said. She predicted that in 50 years' time, oil will be a secondary commodity.

In a statement following her visit, the IMF chief praised Saudi reform efforts and moves to address the economic effects of persistently low oil prices.

"Saudi Arabia is also undertaking reforms to reduce constraints to women entering the workforce," Ms Lagarde said in the statement, pointing to a recent decision to allow women to drive.

Female entrepreneurship could be boosted through fiscal incentives and other policies, she added.

US, Syria now only countries not to sign Paris accord

Nicaragua is the latest country to sign the Paris climate agreement, leaving the US and Syria as the only nations outside the global pact.

The government of President Daniel Ortega said the global 2015 pact represented "the only international instrument that offers the conditions to face global warming and its effects", according to a statement read out by vice president Rosario Murillo.

Mr Trump's move to pull the US out of the agreement faced fierce criticism from world leaders and activists, with former UN Secretary General Ban Ki-moon accusing the US President of "standing on the wrong side of history".

He said: "I am deeply concerned about what President Trump of (the) United States has declared that the US is withdrawing from this Paris agreement.

"I have been speaking out that his vision is politically short-sighted, and economically irresponsible and scientifically wrong. So he is standing on the wrong side of history."

Mr Ban said despite Mr Trump's decision to pull out of the historic Paris agreement, he remained heartened by a US civil society campaign to continue to honour the environmental deal.

"I am encouraged and hopeful that whole worlds will be united in moving ahead with this Paris climate change agreement. This is the political and moral responsibility of our political leaders," he said.

Reflecting on the broader political climate, Mr Ban said he had been "working very closely" with Mr Trump's predecessor Barack Obama, who last week criticised the "politics of division" that characterised the 2016 US presidential race.

Mr Ban also decried the current "lack of commitment" to an international spirit.

"A lack of leaders' global vision that we are living in a very tightly-interconnected small world, and that whatever is happening in this country may affect the neighbouring countries and even all around the world," he said.