Three decades after the District was dubbed the “murder capital” of the United States for its crime-ridden streets and soaring homicide rate, the city has earned a new distinction in a report released this month: one of the safest large cities in the world.

Joining the likes of Tokyo, Singapore and Amsterdam in the upper echelon of the international Safe Cities Index for the first time, Washington, D.C., was especially lauded for its digital security and disaster preparedness in the Economist Intelligence Unit’s biennial report.

The District, at No. 7, was the only U.S. city to crack the top 10 — and one of two in North America, along with Toronto.

The index, which ranks 60 cities across six continents, determines a city’s overall safety by examining 57 indicators, including digital security, access to quality health care, life expectancy, environmental safety, city infrastructure, disaster preparedness, transportation safety, crime, violence and “threat of civil unrest.”

The 2019 report also emphasized climate change, as well as cities’ ability to withstand environmental threats and intensifying natural disasters.

Tokyo was ranked the safest city in the world for the third time, with Singapore and Osaka filling out the top three.

Hong Kong, which has for months been rocked by political upheaval, protests and at times violent clashes with police, dropped from ninth in 2017 to 20th place this year.

The District was ranked 23rd in the 2017 report. Experts attributed its catapult to seventh place as partly influenced by a shift in how data researchers compiled the final list.

The city ranked in the top 10 in three of the index’s most important factors: digital security, health and infrastructure. Kevin Donahue, the District’s deputy mayor for public safety and justice, said the city has placed a priority on safety issues.

“Mayor Muriel Bowser has been laser-focused on creating a safer, stronger D.C. that ensures personal safety and community resilience, but also prioritizes our city’s cyber and infrastructure security,” he said in a statement. “We are honored to be ranked in the top 10 cities.”

Washington came in 23rd for “personal security,” a metric that considers “how at-risk citizens are from crime, violence, man-made threats and natural disasters,” but Washington topped all other U.S. cities on the list — which included Chicago, Dallas, Los Angeles, New York and San Francisco — in part because of the city’s intense disaster preparedness, the report said.

The report’s authors weren’t available to comment Friday.

Violent crime in the District has been steadily declining over the years, although homicides are on the rise this year, up 13 percent from last year.

After the slaying this week of 27-year-old Margery Magill, who was stabbed while walking a dog in the Park View neighborhood of Northwest Washington, Metropolitan Police Chief Peter Newsham called the District “a very, very safe city.” He said the attack on Magill outside an apartment building about 8:45 p.m. Tuesday was “very rare.”

Improving a city’s “personal security” ranking is difficult to do in the short term, the study’s authors wrote. It “involves some longer-term challenges, such as building and maintaining trust with city residents,” the report said. “This can take time but is essential.”

Researchers wrote that the District also benefited from a change in the metrics the index used this year. Rather than counting the number of reported traffic accidents, the 2019 index compared the number of road deaths. It also considered what the index refers to as “resilience-related indicators,” such as the amount of emergency services in the city, catastrophe insurance, disaster-informed development and risk monitoring.

“Washington, DC, does better . . . than in the past because our measures and methodology give a better understanding of its strengths and weaknesses,” according to the report.

The global study examines cities because, according to United Nations data, 56 percent of the world’s population lives in cities. By 2050, the U.N. says, the rate of urban-dwellers will rise to 68 percent.

“The success or failure of cities will define the quality of human life in the years ahead,” the report said.