Lagos, Nigeria’s commercial capital, has been ranked second on the World’s Least Liveable Cities.

Lagos ranks 2nd, behind Damascus and ahead of Tripoli and Dhaka on the annual report by the Economist.

On the other spectrum, Melbourne has topped a list of the World’s Most Liveable city for the seventh year running but terrorism and diplomatic tensions are eroding living conditions worldwide, an annual report from the Economist has found.

The Australian city was ranked number one out of 140 cities, slightly ahead of the Austrian capital Vienna, with the Canadian trio of Vancouver, Toronto and Calgary completing the top five.

“This is a win for all Victorians, who contribute so much to making Melbourne the best place to live in the world,” said Victorian state Premier Daniel Andrews.

The survey, released Wednesday, scores cities on five broad categories: stability; healthcare; culture and environment; education and infrastructure.

Economist’s Intelligence Unit found that medium-sized cities in wealthy countries fared best.

“These can foster a range of recreational activities without leading to high crime levels or overburdened infrastructure,” the report said.

Major hubs like New York, London, Paris and Tokyo were hives of activity but lost points due to high levels of crime and overcrowded public transport.

More broadly, global stability continued to weaken due to the increase in terror-related incidents world wide.

“Violent acts of terrorism have been reported in many countries, including Australia, Bangladesh, Belgium, France, Pakistan, Sweden, Turkey, the UK and the US,” the report found.

“While not a new phenomenon, the frequency and spread of terrorism have increased noticeably and become even more prominent.”

The United States had seen a decline in a number of its cities over the past few years related to growing unrest.

“This stems in part from unrest related to a number of deaths of black people at the hands of police officers,” the report found.

“In addition, the country has seen protests held in response to President Trump’s policies and executive orders.”

It said increased diplomatic tensions — from Russia and the Ukraine to North Korea’s nuclear threat and Iran’s relationship with its neighbours — was leading to declining stability scores around the world.

Conflict was the main factor for those cities finishing on the bottom of the survey, with Syria’s Damascus at number 140, behind Nigeria’s Lagos, under threat from Islamist groups like Boko Haram and Libyan capital Tripoli, caught up in middle eastern strife.

However, based on the indicators examined, it would be difficult to fault this report and conclusion as Lagos with its mega population has the worst imaginable city transport system, very poor and inadequate electricity, high crime, though not as high as Johannesburg, unhealthy and unfriendly for good health with absolutely no recreation facilities within about 20km radius, a high level of lawlessness by public transport operators that really bug down the city activities with almost no control.