Vienna has dislodged Melbourne for the first time at the top of the Economist Intelligence Unit's Global Liveability Index, strengthening the Austrian capital's claim to being the world's most pleasant city to live in.

The two metropolises have been neck and neck in the annual survey of 140 urban centers for years, with Melbourne clinching the title for the past seven editions. This year, a downgraded threat of militant attacks in western Europe as well as the city's low crime rate helped nudge Vienna into first place.

Vienna regularly tops a larger ranking of cities by quality of life compiled by consulting firm Mercer. It is the first time it has topped the EIU survey, which began in its current form in 2004.

At the other end of the table, Damascus retained last place, followed by the Bangladeshi capital Dhaka, and Lagos in Nigeria. The survey does not include several of the world's most dangerous capitals, such as Baghdad and Kabul.

"While in the past couple of years cities in Europe were affected by the spreading perceived threat of terrorism in the region, which caused heightened security measures, the past year has seen a return to normalcy," the EIU said in a statement about the report published on Tuesday.

"A long-running contender to the title, Vienna has succeeded in displacing Melbourne from the top spot due to increases in the Austrian capital's stability category ratings," it said, referring to one of the index's five headline components.